简单几步解决ERROR 2003 (HY000): Can't connect to MySQL server on 'localhost' (10061)

1.启动数据库时,报错ERROR 2003 (HY000): Can't connect to MySQL server on 'localhost' (10061),下图

简单几步解决ERROR 2003 (HY000): Can't connect to MySQL server on 'localhost' (10061)

2.在电脑左下方查找里输入“服务”并打开,下图

简单几步解决ERROR 2003 (HY000): Can't connect to MySQL server on 'localhost' (10061)

3.找到MySQL,并点击启动,mysql即可正常运行,下图。若未找到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)

5.在查找里输入cmd,并选择"以管理员身份运行",下图

简单几步解决ERROR 2003 (HY000): Can't connect to MySQL server on 'localhost' (10061)

6.输入命令 mysqld --install,下图

简单几步解决ERROR 2003 (HY000): Can't connect to MySQL server on 'localhost' (10061)

7.打开服务找到MySQL,并点击启动,下图

简单几步解决ERROR 2003 (HY000): Can't connect to MySQL server on 'localhost' (10061)

8.打开终端,输入mysql登录命令,出现以下信息即数据库正常运行

简单几步解决ERROR 2003 (HY000): Can't connect to MySQL server on 'localhost' (10061)