The following message is displayed: Gotanerror: Connectionerror: Canrsquo; tconnecttolocalMySQLserverthroughsocketlsquo; varlib
The following message is displayed: Got an error: Connection error: Canrsquo; t connect to local MySQL server through socket lsquo;/var/lib/
The following information is displayed:
Got an error: Connection error: Can't connect to local MySQL server through socket '/var/lib/mysql. sock'
The sudden disappearance of mysql. sock is a common problem. If MySQL is installed for the first time, you only need to find out where mysql. sock is.
The preceding error message, mysql. sock, should be in/var/lib/mysql/. If not, click:
# Find/-name mysql. sock
Find out where to put it, and then try again:
# Mysqladmin-S/find the path/mysql. sock-u root {parameter}
That... What should I do if I suddenly disappear or cannot be found?
You have to restart mysql. the tarball installation can be restarted through mysqld or mysqladmin, And the rpm installation can be performed through service mysql restart. However, when mysql. sock does not exist, it may be impossible to restart mysql. If it does not work, you have to first:
# Ps-aux | grep mysql
Then we cut down the pid.
# Kill the pid
Are you sure you have killed all of them?
# Ps-aux | grep mysql
Make sure that none of mysql is in it, and then execute mysqld or service mysql start.