MySQL does not start a problem analysis of a little trick

Source: Internet
Author: User
Tags chmod create directory

Scenario: After migrating the MYSQL5.5.25A data directory (migrated from/var/lib/mysql to/data), the database cannot be started, service MySQL start is executed, the PID cannot be updated, and the error log under the old and new data directory has no information. At this point, not too many of the MySQL experience of the colleague estimates have been dumbfounded.


How do you troubleshoot a similar problem?

Here's a little trick:

Can be changed slightly/etc/init.d/mysql (first backup), the inside of the
$bindir/mysqld_safe--datadir= "$datadir"--pid-file= "$mysqld _pid_file_path" $other _args >/dev/null 2>&1 &

Delete the inside of the >/dev/null, this way to perform service MySQL start will have a message, prompted the following things:

Touch:cannot Touch '/data/localhost.err ':P ermission denied

Chmod:cannot access '/data/localhost.err ':P ermission denied

Touch:cannot Touch '/data/localhost.err ':P ermission denied

Chown:cannot access '/data/localhost.err ':P ermission denied

Mkdir:cannot Create directory '/data ': File exists

Chown:cannot access '/data ': permissiondenied

Chmod:cannot access '/data ': permissiondenied


We have changed the new Data Directory/data Group of the genus, ah, why do not prompt permission. Linux experience is easy to associate with the SELinux is to do strange, sure enough, the implementation of Setenforce 0 after the normal start of MySQL, a false alarm.


This article is from the "Memory Fragments" blog, so be sure to keep this source http://weikle.blog.51cto.com/3324327/1792101

MySQL does not start a problem analysis of a little trick

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.