mysql 错误 ERROR 2003 (HY000): Can't connect to MySQL server on 'localhost' (10061)亲测可以

时间:2021-10-07 00:29:20

在使用MySQL 时  有时会登录遇到错误  ERROR 2003 (HY000): Can't connect to MySQL server on 'localhost' (10061)


以下方法几步解决问题, 让mysql恢复如初(不会删除原有表和数据):

1.找到mysql安装目录,以我的为例:D:\Program Files\MySQL\MySQL Server 5.0\bin  ,在bin 目录下找到  MySQLInstanceConfig.exe,运行它

mysql 错误 ERROR 2003 (HY000): Can't connect to MySQL server on 'localhost' (10061)亲测可以

2.点击Reconfigure Instance, 然后一路Next至此处:

mysql 错误 ERROR 2003 (HY000): Can't connect to MySQL server on 'localhost' (10061)亲测可以

(以下同安装时的情况)点击第3个框,选择gbk。

3.如下图:

mysql 错误 ERROR 2003 (HY000): Can't connect to MySQL server on 'localhost' (10061)亲测可以

4.填写新密码:

mysql 错误 ERROR 2003 (HY000): Can't connect to MySQL server on 'localhost' (10061)亲测可以

6.点击execute  大功完成!

mysql 错误 ERROR 2003 (HY000): Can't connect to MySQL server on 'localhost' (10061)亲测可以

7. 重新进入mysql:


mysql 错误 ERROR 2003 (HY000): Can't connect to MySQL server on 'localhost' (10061)亲测可以