MySQL (Percona Server) is not running, but lock file (/var/[FAILED]sys/mysql) exists

In this tutorial i will show you how to fix 'MySQL not running but lock file exists' error

MySQL (Percona Server) is not running, but lock file (/var/[FAILED]sys/mysql) exists

First you need to delete the lock file

rm /var/lock/subsys/mysql

Be sure that there is no multiple MySQL services running, check MySQL processes and kill them

Example:

ps aux | grep -i mysql

Check the output and kill all processes like below example:

kill -9 5633 24412

 

Start MySQL

service mysql restart

 

You can always monitor the error log in some other window by running 'tail' , to find location of error log follow one of below steps:

A)
mysql --help | grep "Default options" -A 1
cat /etc/my.cnf | grep -i error

 

b)
find / -type f -name my.cnf
cat /etc/my.cnf | grep -i error

Now you can check your error log for more details about the error:

tail -f  /mysql/data/mysql_logs/mysql-error-log.err

 

It's normal to see in the log that ' Database was not shutdown normally!' since we killed the processes earlier.

 

If it's still not working you can try:

Add following to the my.cnf configuration and restart the service

innodb_force_recovery = 1


Subscribe to
for video tutorials updates