Linux 下 Mysql 安装后使用时提示 var lib mysql mysql.sock' 2 的解决
在Linux上把mysql 重新安装了一下,安装好了后怎么也启动不了,出现提示 can#39;t connect to local mysql server through socket #39; v
在Linux上把mysql 重新安装了一下,安装好了后怎么也启动不了,,出现提示 can't connect to local mysql server through socket ' var lib mysql mysql.sock' 2的错误,网上找了一下,解决的方法到是不少,可试了以后都不行。操作后又出现 couldn't find manager or server错误。继续google,看了一个解决方法,于是就试了一下,还真的行了。
记下来:
[root@server ~]# /etc/init.d/mysql start
Starting MySQL..Couldn't find MySQL manager or server
or this error may display in WHM:
Can't connect to local mysql through socket /var/lib/mysql/mysql.sock
Apparently some RPM packages install this file with an incorrect path in the my.cnf file by default, leaving the service unable to start on its own. To fix, simply open /etc/my.cnf in vi and comment out the 'basedir=/var/lib' line like so:
#basedir=/var/lib
Save the file, and restart MySQL (/etc/init.d/mysql restart).
上一篇: 关于ob_start();该怎么解决