An error occurred while backing up mysql, but the website is running normally
Localhost :~ #/Usr/local/mysql/bin/mysqldump -- lock-tables = FALSE-uroot-p webadb_com>/root/webabc. SQL
Enter password:
Mysqldump: Got error: 2002: Can't connect to local MySQL server through socket '/tmp/mysql-5.1.57.sock' (2) when trying to connect
View mysql. socket
Localhost :~ # Netstat-ln | grep mysql
Unix 2 [ACC] stream listening 492228776/tmp/mysql-5.1.57.sock
View mysql Processes
Localhost :~ # Ps aux | grep mysql
Root 3638 0.0 0.0 7552 864 pts/2 S + grep -- color mysql
Root 23896 0.0 0.0 3956 292? S Sep07/bin/sh/usr/local/mysql/bin/mysqld_safe -- datadir =/data/db -- pid-file =/var/run/mysqld/mysql-5.1.57.pid
Mysql 24396 21.8 25.0 2745632 1013672? Sl Sep07 2739: 05/usr/local/mysql/libexec/mysqld -- basedir =/usr/local/mysql -- datadir =/data/db -- user = mysql -- log-error =/var/log /mysql/localhost. err. log -- pid-file =/var/run/mysqld/mysql-5.1.57.pid -- socket =/tmp/mysql-5.1.57.sock -- port = 3306
Restart mysql
Localhost :~ #/Etc/init. d/mysqld restart
MySQL manager or server PID file cocould not be found! ... Failed!
Starting MySQL
........................................ ........................................ .......................... Manager of pid-file quit without updating file .... failed!
View configuration files
AU02:/tmp # cat/etc/myconf/mysql/my. cnf | grep socket
Socket =/tmp/mysql-5.1.57.sock
The above troubleshooting and no error indicates that mysql is running normally. If a problem occurs, you should consider other aspects and think about mysql later. socket runs in/tmp, is a temporary file storage area, restart will be cleared, ls/tmp/grep mysql-5.1.57.socket does not exist, the following operation can be normal.
Create a mysql. socket file in/tmp and change the group owner to mysql.
Touch/tmp/mysql-5.1.57.sock
Chown mysql. mysql/tmp/mysql-5.1.57.sock
This article from "My Heart" blog, please be sure to keep this source http://leeforget.blog.51cto.com/6950397/1297570