当前位置:Gxlcms >
数据库问题 >
Can't connect to local MySQL server through socket '/opt/lampp/var/mysql/mysql.sock' (2)
Can't connect to local MySQL server through socket '/opt/lampp/var/mysql/mysql.sock' (2)
时间:2021-07-01 10:21:17
帮助过:41人阅读
转载▼
出现的问题:
如果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' (2)
标签:启动 sed 目录 报错 出现 jobs ali com mysql启动不了