mysql.sock was lost after Alibaba Cloud restarted
can't connect to local Mysql server through socket '/var/run/mysqld/mysqld.sock
'.
find / -name mysql.sock
Nothing
/usr/bin/mysql_install_db
say failed
service mysql start
says job failed
/ect/mysql/my.cnf
log_error
is under /var/log/mysql/error.log
,
but/var/log
The following mysql.log
and error.log
are both empty, and the following /var/log/mysql/
Also,
there are also a bunch of mysql.log.1.gz
compressed packages
Very urgent, more than 200 G of data
Thank you for the invitation
mysql has two connection methods:
1, TCP/IP
2, socket
The function of mysql.sock is that the server and client are on the same server, and when localhost is used to connect, socket will be used. Connection - nothing more
That is: a MySQL connection established for the host name localhost. The connection process is implemented through a socket file mysql.socket. Therefore, after the file is deleted, the localhost user cannot connect to the MySQL server.
A tcp/ip connection must be established, that is, use 127.0.0.1 instead of localhost as the -h parameter to connect to the MySQL server, such as: mysqladmin -h 127.0.0.1 -u root -p shutdown, to forcefully establish a tcp/ip connection ;
Close the MySQL server, and then restart the MySQL server with localhost as the host name, and it will re-create a socket file.
Reprinted from
http://www.360doc.com/content...
According to the description of the lock in the topic, I think it should be that the mysql process did not start after restarting and did not act as a daemon. You can test whether the mysql service is not started.
The solution to the problem of mysql.sock losing the last picture (it turns out that I also encountered this problem, the method is recorded below)
http://www.oddpi.com/thread-1...
Regenerate a mysql.sock file