This article provides the solution to the following MySQL error:
The server quit without updating PID file
- Open terminal
- Kill the MySQL process
There are different ways to kill the MySQL process. You can try any one of them.
Below are some of the ways listed:
WAY 1
- Run the following command to find the MySQL process ID:
ps aux | grep mysql
- The output will be something like this:
USER PID %CPU %MEM
_mysql 85298 0.0 0.1
- Kill the MySQL process with the following command:
sudo kill -9 [PID]
Here, PID in my case will be 85298.
Hence, I will have to run the following command to kill my MySQL process:
sudo kill -9 85298
WAY 2
- You can also run the
pkill
command that does not require process ID. You can simply write the process name and kill it.
sudo pkill mysql
WAY 3
- You can also see the list of all the processes running with
top
command:
top
- And, kill all the mysqld processes:
sudo killall mysqld
RESTART MYSQL SERVER
- After this, restart MySQL server:
LINUX
sudo /etc/init.d/mysqld restart
//OR
sudo service mysqld restart
//OR
sudo service mysql restart
MACOS
sudo /usr/local/mysql/support-files/mysql.server restart
Hope this helps. Thanks.