Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111)解决方法

Posted hezhiming

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111)解决方法相关的知识,希望对你有一定的参考价值。

问题:正常启动mysql,显示成功,查看状态报错 .并且不能连接

 

查看启动日志,发现是内存不够启动(低配云服务器)

 

解决方案:

  1.停掉一些不使用的进程释放内存

  2.在/var/lib/mysql/下创建一个空的   mysql.pid 文件

   [root@chendu mysql]# echo >> chendu.pid

  3.重新启动

 

以上是关于Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111)解决方法的主要内容,如果未能解决你的问题,请参考以下文章

MySQL Can't connect to MySQL server on 'localhost' (10061)

Jenkins: Can't connect to Docker daemon解决办法

MySQL错误2003:Can't connect to MySQL server (10060)

Can't connect to MySQL server on 'localhost'(10061)解决方法

MySQL:Can't connect to mysql server 10038

解决Can't connect to MySQL server on 'localhost' (10048)