ERROR 2003 (HY000): Can't connect to MySQL server on 'localhost' (10061)

hky87發表於2012-01-13
猜想可能是服務未啟動,啟動MySQL服務
先執行mysqld --install ,再執行net start  mysql

C:\Program Files\MySQL\MySQL Server 5.0\bin>mysql
ERROR 2003 (HY000): Can't connect to MySQL server on 'localhost' (10061)
C:\Program Files\MySQL\MySQL Server 5.0\bin>mysqld-nt --skip-grant-tables

111230 10:45:14 [ERROR] Can't find messagefile 'D:\Program Files\MySQL\MySQL Server 5.0\share\english\errmsg.sys'

111230 10:45:14 [ERROR] Aborting

解決方法:將MySQL Server\bin下的my.ini刪除或修改(我將其改了個名字,後來MySQL資料庫可用之後,我又將其還原了),再執行:
C:\Program Files\MySQL\MySQL Server 5.0\bin>mysqld-nt --skip-grant-tables
 
開啟另一個cmd視窗,輸入mysql

C:\Program Files\MySQL\MySQL Server 5.0\bin>mysql

修改密碼
mysql> use mysql

mysql> update user set password=password("123456")
    -> where user ="root";

Query OK, 1 row affected (0.00 sec)
Rows matched: 1  Changed: 1  Warnings: 

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/10314474/viewspace-714870/,如需轉載,請註明出處,否則將追究法律責任。

相關文章