Error starting MySQL, view the next status, found that the MySQL is not running,but lock exists:
a netizen said May and log file, so the log file to remove, and then restart MySQL finally OK
Looked for the information, basically is to say:
Copy Code code as follows:
# Chown-r Mysql:mysql/var/lib/mysql
# Rm/var/lock/subsys/mysql
# service MySQL Restart
The discovery is still the tip.
Because it is on the cpanel server, the command is also:
Copy Code code as follows:
# yum Remove MySQL Mysql-server
Uninstall MySQL, and then reinstall:
Copy Code code as follows:
Installed after the restart or error found, and carefully looked at, found that the PID file is not named after the current host name, and then executed:
Copy Code code as follows:
# echo ' PS aux | grep MySQL | grep "User=mysql" | Grep-v "grep" | awk ' {print $} ' >> Hostname.pid
Regenerated the next PID file, while modifying owner and group for MySQL:
Copy Code code as follows:
# chown Mysql:mysql Hostname.pid
It is still an error to save and restart later.
Finally found a netizen said May and log file, so the log file to remove, and then restart MySQL finally OK.
A MySQL crash on Red Hat system resulted with:
/etc/init.d/mysql status
Coming back with:
MySQL is not running but lock exists
Solved by removing the lock file:
Rm/var/lock/subsys/mysql
If This happens again it may also is necessary to remove the PID file From/var/lib/mysql