Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

This question already has an answer here:

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.

share|improve this question

migrated from stackoverflow.com Jul 26 '10 at 14:38

This question came from our site for professional and enthusiast programmers.

marked as duplicate by Chris S Mar 20 '13 at 5:36

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

4 Answers 4

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
share|improve this answer

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.

share|improve this answer
    
As you said, I looked for the permissions on the mysql directory, and it shows me full permissions for all users, admin, system.... –  tecks Jul 26 '10 at 14:15
    
i have updated my question, please chk it.. –  tecks Jul 26 '10 at 15:30

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

share|improve this answer
    
i have updated my question, please chk it.. –  tecks Jul 26 '10 at 15:38
    
--datadir="C:\Server\Mysql" ? is that correct? I thought it would be something like C:\Server\Mysql\Data –  nanda Jul 27 '10 at 10:16

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)

share|improve this answer
    
I'm on windows 7, and i ran the cmd interpreter as admin every time, but didnt worked for me... –  tecks Jul 26 '10 at 14:20
    
i have updated my question, please chk it.. –  tecks Jul 26 '10 at 15:30

Not the answer you're looking for? Browse other questions tagged or ask your own question.