MySQL Error – The Server Quit Without Updating PID File

The MySQL error “Starting MySQL. ERROR! The server quit without updating PID file (/var/lib/mysql/” is thrown when MySQL fails to start. This occurs when MySQL is upgraded to a later version or due to insufficient permission and ownership issue in MySQL data directory. The PID file in the MySQL data directory is gone and MySQL wont behave without it. The default MySQL data directory is /var/lib/mysql/. You can see “.err” files inside the MySQL data directory. These are MySQL error logs which will give the exact reason for MySQL failure. Here is the error displayed when the MySQL service is restarted.

[root@server ] service mysql restart

ERROR! MySQL server PID file could not be found!

Starting MySQL… ERROR! The server quit without updating PID file (/var/lib/mysql/



When you receive this error on the MySQL server, there are many solutions to fix it. Let’s check them one by one. You may try to restart MySQL service after performing each step to check if the error is solved. It is recommended to take full backup of MySQL data directory /var/lib/mysql/ before you make any changes to MySQL service.

1) Connect to your server via SSH as root user and restart MySQL manually. Sometimes restarting the MySQL server may fix this issue. You can use either of the following command to restart MySQL server.

# /etc/init.d/mysql restart


# service mysql restart

2) You need to check whether the MySQL service is already running. If MySQL service is already running, you will have to kill them and start again. Use the following command to check if there is a MySQL service running already.

# ps -aux | grep -i mysql

If MySQL service is already running, you will get list of MySQL processes with PIDs. The PID is the process ID of the MySQL processes. You will have to kill those processes.

# kill -9 PID

PID – Process ID of the MySQL process.

3) Check the ownership of MySQL data directory /var/lib/mysql/. Use the following command to check ownership of MySQL service

# ll -aF /var/lib/mysql/

If it’s owner is root, you should change the ownership to MySQL or your user by using the following command.

# chown -R mysql /var/lib/mysql/

4) Take a backup of mysql.sock file and remove it. To achieve this, use the following commands:

# cp /var/lib/mysql.sock /var/lib/mysql.sock_bkp

# rm -rf /var/lib/mysql.sock

5) Remove MySQL configuration file /etc/my.cnf or just back it up for now and restart:

# mv /etc/my.cnf /etc/my.cnf.bak

6) Remove the log file named ib_logfile in the MySQL data directory /var/lib/mysql/ or just back it up now and restart the MySQL service. Sometimes MySQL service fails to start when it faces difficulty in updating the log files. The log files will be created automatically once you restart the MySQL service. Use the following command to remove the log files and back it up.

Change the present working directory to MySQL data directory.

# cd /var/lib/mysql

Backup and remove the log files by renaming them.

# mv ib_logfile0 ib_logfile0.bak

# mv ib_logfile1 ib_logfile1.bak

Move the backups to a temporary location.

# mv /var/lib/mysql/ib_logfile* /tmp/folder/

7) Find the log files with suffix “.err” in the MySQL data directory /var/lib/mysql/. These files contain the actual error message. You can use any editor or command like cat, less to read the error message from the log files.

# cat /var/lib/mysql/yourservername.err

In many cases, MySQL will run soon after removing this error files.

# rm -rf /var/lib/mysql/yourservername.err


If you need any further assistance please contact our support department.