Centos下的MySql登录出现 ERROR 2002 (HY000): Cant't connect to local MySQL server through socket '/var/lib/mysql/mysqlsock'(2)

场景:登录MySQL出现

 

 

 处理方式:找了老久,从日志里头发现是3306端口被占用

1)查看Mysql日志

cat /var/log/mysql/mysqld.log

 

 

 2)查看被运行的端口

netstat -ano

 

 

 3)kill掉该端口(3306)

fuser -k 3306/tcp

4)重启MySql服务

systemctl start mysqld.service

5)登录MySql

mysql -u root -p

 

 

感谢:https://www.cnblogs.com/waycx/p/10084447.html

https://blog.csdn.net/qq_31680395/article/details/80441267

http://blog.sina.com.cn/s/blog_6264e0aa0102xj47.html

https://blog.csdn.net/kong_lev/article/details/72857520

 

posted @ 2021-06-17 15:56  蜗牛的礼物  阅读(227)  评论(0编辑  收藏  举报