MySQL 服务无法启动 ERROR 2003 (HY000): Can't connect to MySQL server on 'localhost' (10061)

时间:2022-01-31 04:16:56

1.问题情况:下载了mysql5.7绿色免安装版,但是一直出现下面的错误:

mysql 服务无法启动

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

如下两图所示:

MySQL 服务无法启动 ERROR 2003 (HY000): Can't connect to MySQL server on 'localhost' (10061)

MySQL 服务无法启动 ERROR 2003 (HY000): Can't connect to MySQL server on 'localhost' (10061)MySQL 服务无法启动 ERROR 2003 (HY000): Can't connect to MySQL server on 'localhost' (10061)

MySQL 服务无法启动 ERROR 2003 (HY000): Can't connect to MySQL server on 'localhost' (10061)

2.问题原因:mysql5.7绿色免安装版目录下没有data文件夹以及这个文件下的一些问些文件。

MySQL 服务无法启动 ERROR 2003 (HY000): Can't connect to MySQL server on 'localhost' (10061)

MySQL 服务无法启动 ERROR 2003 (HY000): Can't connect to MySQL server on 'localhost' (10061)
3.问题解决:在cmd下输入mysqld --initialize,让mysql自动初始化data文件夹。然后就可以正常启动mysql服务了。

MySQL 服务无法启动 ERROR 2003 (HY000): Can't connect to MySQL server on 'localhost' (10061)MySQL 服务无法启动 ERROR 2003 (HY000): Can't connect to MySQL server on 'localhost' (10061)

后记:oracle似乎有意让mysql用起来不方便...

解决办法出处:http://bbs.csdn.net/topics/391851148  第20楼