table of Contents
1. Reason analysis
Change the MySQL data storage location to the address of the data disk, restart the machine, and then the disk mount is not set to automatically mount at startup, resulting in the PID file not being found.
2. Problem positioning
Check the log, /var/log/mysql check the reason
Three, the solution
1. Check the location of pid-file in /etc/my.cnf
pid-file=/var/run/mysqld/mysqld.pid
2. Create the corresponding directory and modify permissions
mkdir -p /var/run/mysqld
chown mysql.mysql /var/run/mysqld
At this time, you can try to restart mysql. If it still does not work, continue to the third step. At this step, my MySQL has been started.
3. Create a pid file and modify permissions
touch /var/run/mysql/mysqld.pid
chown mysql.mysql /var/run/mysql/mysqld.pid
Restart MySQL should be no problem