How to fix error "Starting MySQL... ERROR! The server quit without updating PID file"

fwh

Administrator
Staff Member
Joined
Dec 8, 2012
Messages
773
Points
63
Today I made some changes on MySQL configuration file and restart Mysql server with the command

Code:
sudo service mysqld start
but whoopp... it made website databases error and MySQL could not be restarted.

[root@server ~]# sudo service mysqld start
Starting MySQL... ERROR! The server quit without updating PID file (/var/lib/mysql/server.example.com.pid).
I tried to find solutions on Google and more results from stackoverflow or serverfault but most answers are common and could not solve this problem completely.

This is my way to solve this problem

Code:
mv /etc/my.cnf /etc/my.cnf.old
After that, restarted Mysql and succeeded.

Code:
[root@server ~]# service mysqld restart
Shutting down MySQL.. SUCCESS!
But where is my.cnf ? it was moved to my.cnf.old and I will lose this mysql configuration file?

I tried to copy the backup file my.cnf to /var/lib/mysql/ and restarted Mysql again but still getting same error.

[root@server ~]# sudo service mysqld start
Starting MySQL... ERROR! The server quit without updating PID file (/var/lib/mysql/server.example.com.pid).
So I tried this way

Code:
sudo killall mysqld
This make sure that It will stop all mysql services including PID file (/var/lib/mysql/server.example.com.pid)

now I copied file my.cnf back and start mysql again

Code:
service mysqld restart
[root@server ~]# sudo service mysqld start
Starting MySQL SUCCESS!
The problem is solved and I can use my.cnf as before.

Hope I will not face this problem any more :D


Regards,
 
Newer Threads
Similar Threads

Latest Hosting OffersNew Reviews

Sponsors

Tag Cloud

You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an alternative browser.

Top