I found that the mysql backup is not normal today, prompting that the mysql-5.1.57.socket could not be found

Source: Internet
Author: User
Tags temporary file storage mysql backup

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.