Or use this method:
ln -s /usr/local/mysql5.7/data/s1/s1.sock /tmp/mysql.sock
is successful, that's it
ln -s /usr/local/mysql5.7/data/ s1/s1.sock /tmp/mysql.sock
http://blog.csdn.net/ixidof/article/details/5958904/Reference
: http://www.aiezu.com/db/mysql_cant_connect_through_socket.htmlHow to
protect"/ tmp/mysql.sock" is not deleted
If you have this problem, virtually anyone can delete the MySQL communication socket "/tmp/mysql.sock", on most versions of Unix, you can do this by setting sticky (t) bit to protect your "/tmp" filesystem. Log in as root and do the following:
shell> chmod +t /tmp
This will protect your "/tmp" filesystem so that files can only be deleted by their owner or superuser (root).
You can do ls -ld /tmp to check if the sticky bit is set, if the last permit bit is t, the bit is set.
Reference:
http://bbs.csdn.net/topics/20279300
Connect to Mysql prompt Can't connect to local MySQL server through socket solution
Guess you like
Origin http://43.154.161.224:23101/article/api/json?id=326442033&siteId=291194637
Recommended
Ranking