net stop mysql 先停下当前mysql服务 c:\mysql-init.txt 内容如下 UPDATE mysql.user SET Password=PASSWORD('phpsir') WHERE User='root'; FLUSH PRIVILEGES;
然后 启动 mysql
C:\>"C:\Program Files\MySQL\MySQL Server 5.5\bin\mysqld.exe"
--defaults-file="C:\\Program Files\\MySQL\\MySQL Server 5.5\\my.ini"
--init-file=C:\\mysql-init.txt --console
参考 : http://dev.mysql.com/doc/refman/5.5/en/resetting-permissions.html