Centos 下启动mysql 报错: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111)解决方法

时间:2021-07-05 17:35:04   收藏:0   阅读:0

1、启动服务

systemctl restart mysqld.service

报错:

启动数据库Can‘t  connect to MYSQL server through socket ‘‘var/lib/mysql/mysql.cock(146 lock timed out:Retry transaction)

2、解决办法

cd /var/lib/mysql 
#备份mysql.sock
sudo mv mysql.sock mysql.sock.bak

再次登录

mysql -uroot -proot

成功!!

参考链接:https://www.cnblogs.com/invban/p/5824796.html

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!