Thursday, February 3, 2011

reset forgotten mysql password

I followed this link (http://dev.mysql.com/doc/refman/5.0/en/resetting-permissions.html) to reset my forgotten password in mysql server on windows machine.

I'm getting the following error,

C:\>"C:\Server\Mysql\bin\mysqld" --defaults-file="C:\Server\Mysql\my.ini" --init
-file=C:\\mysql-init.txt
100725 23:45:35 [Warning] '--default-character-set' is deprecated and will be re
moved in a future release. Please use '--character-set-server' instead.
100725 23:45:35 [Note] Plugin 'FEDERATED' is disabled.
100725 23:45:36  InnoDB: Operating system error number 5 in a file operation.
InnoDB: The error means mysqld does not have the access rights to
InnoDB: the directory. It may also be you have created a subdirectory
InnoDB: of the same name as a data file.
InnoDB: File name .\ibdata1
InnoDB: File operation call: 'open'.
InnoDB: Cannot continue operation.

To run the above command, i logged into the command line interpreter as admin.

I tried to run with --datadir option, and i got the following output in log,

C:\>"C:\Server\Mysql\bin\mysqld" --datadir="C:\Server\Mysql" --defaults-file="C:
\Server\Mysql\my.ini" --console  --init-file=C:\\mysql-init.txt
100726 10:57:26 [Warning] '--default-character-set' is deprecated and will be re
moved in a future release. Please use '--character-set-server' instead.
100726 10:57:26 [Note] Plugin 'FEDERATED' is disabled.
C:\Server\Mysql\bin\mysqld: Table 'mysql.plugin' doesn't exist
100726 10:57:26 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgr
ade to create it.
100726 10:57:26  InnoDB: Started; log sequence number 0 44233
100726 10:57:26 [ERROR] C:\Server\Mysql\bin\mysqld: unknown variable 'defaults-f
ile=C:\Server\Mysql\my.ini'
100726 10:57:26 [ERROR] Aborting

100726 10:57:26  InnoDB: Starting shutdown...
100726 10:57:31  InnoDB: Shutdown completed; log sequence number 0 44233
100726 10:57:31 [Note] C:\Server\Mysql\bin\mysqld: Shutdown complete

as mentioned above, when i tried to run mysql_upgrade file, it doesnt, as it requires to login.

  • Check the permissions on your C:\Server\Mysql directory. Make sure your user has access; administrators do not magically have permissions to everything, they just have the right to give themselves permission to anything on the local system.

    tecks : i have updated my question, please chk it..
    From Borealid
  • Seems that MySQL can't find the data directory. Try to supply it with --datadir

    tecks : i have updated my question, please chk it..
    nanda : --datadir="C:\Server\Mysql" ? is that correct? I thought it would be something like C:\Server\Mysql\Data
    From nanda
  • Even though you're logged in as administrator doesn't mean the process "mysqld" has access to those folders. It almost sounds like you're running this on Vista or Windows 7 if I'm not mistaken. Try to disable DEP and try again (when you see cmd.exe, right click it and select "Run as Administrator instead of just left clicking it)

    tecks : i have updated my question, please chk it..

0 comments:

Post a Comment