WebHostingPeople Blog

How Can We Help?

MySQL Error – The Server Quit Without Updating PID File

You are here:

The MySQL problem “Commencing MySQL. ERROR! The server quit without updating Process ID file (/var/lib/mysql/yourservername.pid)” is thrown when MySQL fails to initiate. This happens 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 missing and MySQL won’t function without it. The default MySQL data directory is /var/lib/mysql/. You can find “.err” files inside the MySQL data directory. These are MySQL error logs which will provide the exact reason for MySQL failure. Here is the error exhibited when the MySQL service is restarted.

[root@server ] service mysql restart

ERROR! MySQL server Process ID file could not be found!

Initiating MySQL… ERROR! The server quit without updating Process ID file (/var/lib/mysql/server.vasco.com.pid)

 

Solution

When you encounter this problem on the MySQL server, there are numerous solutions to fix it. Let’s examine them one by one. You may attempt to restart the MySQL service after executing each step to check if the problem is resolved. It is suggested to take a full backup of the MySQL data directory /var/lib/mysql/ before making any modifications to the MySQL service.

1) Connect to your server via SSH as root user and restart MySQL manually. Occasionally, restarting the MySQL server may resolve this problem. You can use either of the following command to restart the MySQL server.

# /etc/init.d/mysql restart

or

# service mysql restart

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

# ps -aux | grep -i mysql

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

# kill -9 PID

PID – Process ID of the MySQL process.

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

# ll -aF /var/lib/mysql/

If it is owned by root, you should change the ownership to MySQL or your user by executing the following command.

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

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

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

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

5) Remove the 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 the MySQL service fails to start when it encounters 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 them up.

Change the present working directory to the 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 the 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 these error files.

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

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

MySQL Server Ceased Operation and Failed to Update PID File

Post Your Comment