mysql -u root -p 报错ERROR 2003 (HY000):: Can't connect to MySQL server on 'localhost' (10061)

1.在这里插入图片描述原因:上一次net stop mysql 后未开启
以管理员身份启动cmd命令行
输入net start mysql 报错:mysql 服务器无法启动
mysql -u root -p 报错ERROR 2003 (HY000):: Can't connect to MySQL server on 'localhost' (10061)_第1张图片
解决方案:
mysqld --initialize 初始化data目录后重新输入net start mysql命令即可。
mysql -u root -p 报错ERROR 2003 (HY000):: Can't connect to MySQL server on 'localhost' (10061)_第2张图片

你可能感兴趣的:(mysql -u root -p 报错ERROR 2003 (HY000):: Can't connect to MySQL server on 'localhost' (10061))