Unable to find Mysql.sock,mysql.sock lost problem resolution
First, solve Var/run/mysqld no PID and sock files
MySQL Mysql.sock lost because of the cause of the loss is generally due to inconsistent configuration files, mysqld error starts, Mysqld_safe will clear the mysql.sock. The workaround is to:
It is not possible to create/tmp/mysql.sock and hostname.pid files because the normal person does not switch to the MySQL user when resolving the failure, causing permissions problems and unable to create the MySQL authorization table. Therefore, the summary solution is as follows:
#su mysql//root user is also possible
$/usr/local/bin/mysql_install_db//To Bin directory execution, rebuild authorization form
$/usr/local/bin/mysqld_safe &
MYSQL-UROOT-P//test
mysq>bye;
$
Files have been resolved to regenerate new/tmp/mysql.sock and Hostname.pid
var/
$SU Root
Second, resolve the Mysql.sock file path is not correct
1. Create a link:ln-s/var/lib/mysql/mysql.sock/path/to/mysql/mysql.sock in/var/lib/mysql
2. Under root permissions, modify the My.cnf file (/etc/mysql/my.cnf) to specify the correct path
Either 3.1 and 2 can be selected
Unable to find Mysql.sock,mysql.sock lost problem resolution