該錯誤只在windows系統上出現,據說這個錯誤已經存在n年了,有人 extremely dispointed that it still exists here in 2009!
錯誤的原因更令人抓狂,那就是mysql server instance config wizard根本沒有為你設密碼,于是root密碼是空!實在不明白如果沒有為我設密碼那中間為什么叫我設個密碼。。。。。。。
解決辦法:
I clicked Skip on the dialog that states the Error 1045...
Then cancelled the "MySQL Server Instance Config Wizard"
Now...
Open a command prompt (cd 到Mysql的bin目錄下)
type "mysql -u root -p" then
hit enter again when it requests a password.
You should now have access to the mysql monitor...
type the following at the prompts...
mysql>use mysql
mysql>select user, host, password from user;
# Now you should see that u have 3 entries
+-----------------------------+
| user | host | password |
+-----------------------------+
| root | localhost | |
| root | 127.0.0.1 | |
| | localhost | |
+-----------------------------+
mysql> delete from user where host="localhost" and user="";
mysql> update user set password=password("xxxx") where user="root";
mysql> flush tables;
mysql> flush privileges;
mysql> quit
Now the mysql table should be updated and everything fixed.
Try it out...
然后就可以用config wizard跑一遍了。。。