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