mysql连接错误: Can’t connect to local MySQL server through socket /tmp/mysql.sock
2010-09-01 11:08
567 查看
原因一:这是由于当mysql-client连接一个本地的mysql-server时,并不是使用localhost loopback address 127.0.0.1, 而是使用了一个本地文件。默认情况下这个本地文件存在 /tmp/mysql.sock. 但是,由于各种各样的原因,很多mysql安装将这个文件存放在/var/lib/mysql/mysql.sock. 解决办法如下:1. 暂时更改:
mysql --socket=/var/lib/mysql/mysql.sock ...2. 更改配置文件修改文件/etc/my.conf, 加入
[client] socket=/var/lib/mysql/mysql.sock原因二:权限问题先关掉SElinux,然后再进行如下操作:#chown -hR root /opt/lampp# /opt/lampp/lampp start# chmod 777 -R /opt/lampp/var但又出现问题:XAMPP: Starting MySQL…Warning: World-writable config file ‘/opt/lampp/etc/my.cnf’ is ignoredWarning: World-writable config file ‘/opt/lampp/etc/my.cnf’ is ignored最后又用如下命令,解决:#cd /opt/lampp/etc#chmod 755 my.cnf重启后正常!
相关文章推荐
- Mysql连接错误:ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (
- 解决Can’t connect to local MySQL server through socket ‘/tmp/mysql.sock’错误
- 记录mysql错误:Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
- 解决Can’t connect to local MySQL server through socket ‘/tmp/mysql.sock’错误
- mysql错误之Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
- 解决Can’t connect to local MySQL server through socket ‘/tmp/mysql.sock’错误
- mysql连接之ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2
- 解决Can’t connect to local MySQL server through socket ‘/tmp/mysql.sock’错误
- ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
- 'Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)'
- mac终端运行mysql出现Can't connect to local MySQL server through socket '/tmp/mysql.sock'
- mysql error 2002 (HY000) : Can't connect to local MySQL server through socket '/tmp/mysql.sock'
- 阿里云报错:ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock’
- 解决Can 't connect to local MySQL server through socket '/tmp/mysql.sock '(2) ";
- mysql运行中问题Can't connect to local MySQL server through socket '/tmp/mysql.sock'
- [mysql]Can't connect to local MySQL server through socket '/tmp/mysql.sock'
- 连接MySql报错“can't connect to local mysql server through socket '/var/run/mysqld/mysqld.sock'”
- Linux下 配置mysql Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
- Mysql error 2002 (HY000) : Can't connect to local MySQL server through socket '/tmp/mysql.sock'
- 解决*unix系统下Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)