首页 > 代码库 > 在/etc/my.cnf未配置 [clIent] 导到mysql找不到socket

在/etc/my.cnf未配置 [clIent] 导到mysql找不到socket

 

[root@DB mysql-5.6.16]# ./bin/mysql
ERROR 2002 (HY000): Can‘t connect to local MySQL server through socket ‘/tmp/mysql.sock‘ (2)

 在/etc/my.cnf增加[clIent]并指定socket

[root@DB mysql-5.6.16]# grep client -C 2 /etc/my.cnf
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
[client]
socket=/var/lib/mysql/mysql.sock

 

在/etc/my.cnf未配置 [clIent] 导到mysql找不到socket