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

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

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

上一篇:数据库操纵语言(DML)


下一篇:The transaction log for database 'xxxx' is full due to AVAILABILITY_REPLICA error message in SQL Server