After centos is shut down abnormally, mysql cannot be started.

Source: Internet
Author: User
After centos is shut down abnormally, mysql cannot be started. The problem is as follows: AnotherMySQLdaemonalreadyrunningwiththesameunixsocket is because there is a mysql. sock file in the mysql installation directory. This file was created when mysql was started and deleted when mysql was disabled. If it is not properly shut down, mysql will not

After centos is shut down abnormally, mysql cannot be started. the problem is as follows: Another MySQL daemon already running with the same unix socket is that there is a mysql. sock file in the mysql installation directory. This file was created when mysql was started and deleted when mysql was disabled. If it is not properly shut down, mysql will not

After centos is shut down abnormally, mysql cannot be started. The problem is as follows:

Another MySQL daemon already running with the same unix socket

The reason is that there is a mysql. sock file in the mysql installation directory.

This file was created when mysql was started and deleted when mysql was disabled.

If it is not properly shut down, mysql will not be able to delete the file.

When this file still exists, mysql cannot be started and the above error is prompted.

In a strange situation, google and Baidu did not have a solution to this problem.

Then I can only use my own method to solve the problem, that is, before mysql is started, I will delete it if mysql. sock exists.

1

2

3

4

5

6

/etc/rc.sysinit

# Clean up mysql sock

if [ -x /var/lib/mysql/mysql.sock ]; then

rm -f /var/lib/mysql/mysql.sock

fi

After several power outages (abnormal shutdown), mysql can be started normally.

This problem will always be solved.

Original article address: After centos is shut down abnormally, mysql cannot be started. Thank you for sharing with me.

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.