2

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.

tecks
  • 21
  • 1
  • 3

4 Answers4

1

I found this, tried and it worked.

The solution was basically to make sure --defaults-file is the first parameter in the chain.

For me this did NOT work:

mysqld --init-file=C:/mysql-init.txt --defaults-file="C:/Program Files/MySQL/MySQL Server 5.5/my.ini" --datadir="C:/Documents and Settings/All Users/Application Data/MySQL/MySQL Server 5.5/Data/" --console

but this one DID WORK:

mysqld --defaults-file="C:/Program Files/MySQL/MySQL Server 5.5/my.ini" --init-file=C:/mysql-init.txt --datadir="C:/Documents and Settings/All Users/Application Data/MySQL/MySQL Server 5.5/Data/" --console
mgorven
  • 30,036
  • 7
  • 76
  • 121
Pablo
  • 11
  • 1
0

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.

Borealid
  • 240
  • 1
  • 3
  • As you said, I looked for the permissions on the mysql directory, and it shows me full permissions for all users, admin, system.... –  Jul 26 '10 at 14:15
  • i have updated my question, please chk it.. – tecks Jul 26 '10 at 15:30
0

Seems that MySQL can't find the data directory. Try to supply it with --datadir

nanda
  • 101
  • 3
0

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)

AcidRaZor
  • 151
  • 3