在/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

 

posted @ 2017-06-28 16:32  bass  阅读(1365)  评论(1编辑  收藏  举报