可以设定命令行读取SOCK文件地址:
zhaowei@zhaowei-laptop:/data0/mysql/3306$ sudo vim /etc/mysql/my.cnf
输入以下内容,覆盖系统默认设置参数
1 [client]
2 socket =/tmp/mysql.sock
重启MYSQL
zhaowei@zhaowei-laptop:/data0/mysql/3306$ mysql
Welcome to the MySQL monitor. Commands end with ; or /g.
Your MySQL connection id is 3
Server version: 5.5.2-m2-log Source distribution
Type 'help;' or '/h' for help. Type '/c' to clear the current input statement.
mysql>