Can't connect to local MySQL server through socket '/opt/lampp/var/mysql/mysql.sock'

Posted python-xiakaibi

tags:

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

ERROR 2002 (HY000): Can‘t connect to local mysql server through socket ‘/opt/lampp/var/mysql/mysql.sock‘ (2)

 

 

 

原因:系统盘满了

[[email protected] opt]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VolGroup-lv_root
18G 17G 0 100% /
tmpfs 504M 0 504M 0% /dev/shm
/dev/sda1 477M 80M 372M 18% /boot
[[email protected] opt]#

解决:

删除大文件后,重启系统解决

 

 

[[email protected] mysql]# /opt/lampp/lampp status
Version: XAMPP for Linux 1.8.3-3
Apache is not running.
MySQL is not running.
ProFTPD is running.

 

df: 未处理文件系统
[[email protected] opt]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VolGroup-lv_root
18G 17G 0 100% /
tmpfs 504M 0 504M 0% /dev/shm
/dev/sda1 477M 80M 372M 18% /boot
[[email protected] opt]#

 

 

[[email protected] ~]# /opt/lampp/lampp status
Version: XAMPP for Linux 1.8.3-3
Apache is not running.
MySQL is running.
ProFTPD is running.

 

 

 

xampp 无法启动mysql 找不到mysql.sock

 (2016-02-24 23:21:24)
  分类: 技术
出现的问题:
如果xampp中的mysql启动不了,出现ERROR 2002 (HY000): Can‘t connect to local MySQL server through socket ‘/opt/lampp/var/mysql/mysql.sock‘ (2)报错,
停止xampp的时候报:
-bash-4.1# /opt/lampp/lampp stop
Stopping XAMPP for Linux 1.8.2-6...
XAMPP: Stopping Apache...ok.
XAMPP: Stopping MySQL...ok.
XAMPP: Stopping ProFTPD...kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]
fail.

解决办法:
如果网上一些方法不好用的话,可以试试以下方法:
1. 确定系统盘是否满了
#df -h
2. 删除/opt/lampp目录中的pid文件(删掉后xampp重启时会重建,如果不放心,可以先备份lampp目录)
删除mysql相关缓存:
#rm -rf /opt/lampp/var/mysql/VM_*  
删除proftp相关缓存:
#rm -rf /opt/lampp/var/proftpd.pid
如果找不到pid文件,可以搜一下:
#find /opt/lampp -name ‘*.pid‘

 

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

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)