当使用mysql 本地client连接mysql提示如下错误:
[root@k8s-node1 mysql]# mysql -u root -ptest1234
mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
原因就是/tmp/mysql.sock文件不存在
查看/etc/my.cnf 文件配置
可以看到socket配置并不是/tmp/mysql.sock
解决:修改上面的配置为/tmp/mysql.sock
重启mysql,问题解决
[root@k8s-node1 mysql]# mysql -u root -ptest1234
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 8
Server ver