Another MySQL daemon already running with the same UNIX socket

Source: Internet
Author: User

Mysql After the server loses power, it discovers that the site link database failed, after viewing the data set status


[Email protected]~]# service mysqld Status

Mysqldis stopped

[Email protected]dbserver1~]# chkconfig--list mysqld

Mysqld 0:off 1:off 2:on 3:on 4:on 5:on 6:off

[[Email protected]~]# service mysqld Start

Another mysqldaemon already running with the same UNIX socket


View socket in MY.CNF File Location

Socket=/var/lib/mysql/mysql.sock

[Email protected]~]# ls-l/var/lib/mysql/mysql.sock

Discovery exists, guess is power off after Mysql.sock is not cleared, legacy issues

When the database was started, Mysql.sock was found to be present, so MySQL failed to start

Workaround:

[[Email protected]~]# Mv/var/lib/mysql/mysql.sock/var/lib/mysql/mysql.sock.bak

[[Email protected]~]# service mysqld Start

STARTINGMYSQLD: [OK]

The same test on other servers, after the power outage, MySQL can start normally

To prevent this problem, you can add the following code after "start" in/etc/init.d/mysqld

Test-e/var/lib/mysql/mysql.socksockexist=$? PS CAx | grep mysqld_safenopidmysql=$? echo nopidmysql $NOPIDMYSQLecho sockexist $SOCKEXIST If [$NOPIDMYSQL-eq 1] && [$SOCKEXIST-eq 0]; Then echo "Notclean" Rm-f/var/lib/mysql/mysql.sock echo "FILE sockremoved" Else echo "clean" fi




This article is from "The girl said" blog, please be sure to keep this source http://sugarlovecxq.blog.51cto.com/6707742/1679996

Another MySQL daemon already running with the same UNIX socket

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.