完美解决MySql连接报错问题: Can't connect to local MySQL server through socket '/data/mysql/mysql-8/mysql.sock'

查找位置:

find / -name mysql.sock

一般都是在/tmp/mysql.sock

建立连接:

ln -s /tmp/mysql.sock /data/mysql/mysql-8/mysql.sock

把/data/mysql/mysql-8/mysql.sock连接到/tmp/mysql.sock

然后就可以了。

你可能感兴趣的:(完美解决MySql连接报错问题: Can't connect to local MySQL server through socket '/data/mysql/mysql-8/mysql.sock')