If you’re running your website or application on a Linux server, then you should learn a thing or two about MySQL. Otherwise you’d constantly be bothered by errors like the “The Server Quit” error. When firing up your MySQL server, you’ll notice a error message flashing on the screen which reads, “The Server Quit Without Updating PID File”. You may also experience the error when installing MySQL onto your system.
So what’s going on here? You’ll be quick to notice that there’s something called a PID file. And that’s where the problem lies. There’s no PID file in the MySQL data directory and your MySQL won’t work properly without it.
In this article, we explain how to fix the server quit error in a few easy steps.
When Do We Get This Error?
You’ll get the server quit error when MySQL server fails to load. MySQL server is the server that runs your website and application database, and cPanel database. There are many reasons why at times the server may fail to load.
In this scenario, the error occurs because of any of the three reasons:
The MySQL has upgraded to a newer version
There is insufficient permission to access the database server
There are ownership issues within the data directory
In each of the cases, the PID file either becomes inaccessible or gets deleted. If you’re wondering what a PID file is, then it’s a simple text file with .pid extension containing the process Identification numbers (PID) of a running programs. Other programs can access this file to identify the running script.
When this file goes missing, the identification process is hindered.
The Solution
Just like there are many reasons that can result in the error, there are many solutions to it. You can try out the following methods.
Restart MySQL Server
The first solution we’d recommend trying is to restart MySQL server. It’s going to be simple and straightforward. And in most cases, restarting should solve the error. Before you move ahead with the process, you must take a full back of the MySQL data directory. Once you’ve back up, follow the following steps:
Open SSH and connect to the server
Restart MySQL manually by using this command:
This should fix the error. If not, move ahead with the other solutions mentioned below.
Kill MySQL Process and Start Again
Check if the MySQL service is running by using this command: # ps -aux | grep - i mysql. if yes, then kill the process and restart using the above command.
Once the service restarts, you’ll get a list of PIDs that are available. You need to kill them by using this command:
Check Ownership
At times, incorrect ownership access may result in the MySQL server quit error. So you need to change the ownership from root user to MySQL or the current user.
Use this command to check the ownership of MySQL :
If root is the owner, you’d have to change it to MySQL with this command:
There are other ways to solve this error too, but the above recommended solutions should fix it. Now you shouldn’t get the error anymore. If problem persists, you need to get in touch with your system administrator.
So what’s going on here? You’ll be quick to notice that there’s something called a PID file. And that’s where the problem lies. There’s no PID file in the MySQL data directory and your MySQL won’t work properly without it.
In this article, we explain how to fix the server quit error in a few easy steps.
When Do We Get This Error?
You’ll get the server quit error when MySQL server fails to load. MySQL server is the server that runs your website and application database, and cPanel database. There are many reasons why at times the server may fail to load.
In this scenario, the error occurs because of any of the three reasons:
The MySQL has upgraded to a newer version
There is insufficient permission to access the database server
There are ownership issues within the data directory
In each of the cases, the PID file either becomes inaccessible or gets deleted. If you’re wondering what a PID file is, then it’s a simple text file with .pid extension containing the process Identification numbers (PID) of a running programs. Other programs can access this file to identify the running script.
When this file goes missing, the identification process is hindered.
The Solution
Just like there are many reasons that can result in the error, there are many solutions to it. You can try out the following methods.
Restart MySQL Server
The first solution we’d recommend trying is to restart MySQL server. It’s going to be simple and straightforward. And in most cases, restarting should solve the error. Before you move ahead with the process, you must take a full back of the MySQL data directory. Once you’ve back up, follow the following steps:
Open SSH and connect to the server
Restart MySQL manually by using this command:
Code:
# /etc/init.d/mysql restart or # service mysql restart
Kill MySQL Process and Start Again
Check if the MySQL service is running by using this command: # ps -aux | grep - i mysql. if yes, then kill the process and restart using the above command.
Once the service restarts, you’ll get a list of PIDs that are available. You need to kill them by using this command:
Code:
# kill -9 PID
At times, incorrect ownership access may result in the MySQL server quit error. So you need to change the ownership from root user to MySQL or the current user.
Use this command to check the ownership of MySQL :
Code:
# ll -aF /var/lib/mysql/
Code:
# chown -R mysql /var/lib/mysql/