我跟着这个链接( http://dev.mysql.com/doc/refman/5.0/en/resetting-permissions.html )重置我忘记密码在Windows服务器上的MySQL服务器。
我收到以下错误,
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.
要运行上述命令,我以admin身份login到命令行解释器。
我试图用–datadir选项运行,我在日志中得到以下输出,
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
如上所述,当我试图运行mysql_upgrade文件,它不,因为它需要login。
我发现这一点 ,试过,它的工作。
解决scheme基本上是确保--defaults-file是链中的第一个参数。
对我来说这是行不通的:
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
但是这一个DID工作 :
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
检查您的C:\Server\Mysql目录上的权限。 确保您的用户有权访问; pipe理员不会奇迹般地拥有一切权限,他们只是有权为本地系统上的任何东西授予权限。
似乎MySQL找不到数据目录。 尝试提供--datadir
即使您以pipe理员身份login,并不意味着进程“mysqld”有权访问这些文件夹。 这几乎听起来像你在Vista或Windows 7上运行,如果我没有弄错。 尝试禁用DEP并再次尝试(当您看到cmd.exe时,右键单击它并select“以pipe理员身份运行,而不是仅仅左键单击它)