Problem StatementMySQL server could not get started.
Error Message:The server quit without updating PID file. OR
Starting MySQL... ERROR! The server quit without updating PID file (/var/lib/mysql/server-name.com.pid)
Solution:When you receive these errors on MySQL server, there are lots of solutions available to fix it. Let's check them out one by one:[LIST=1][*]Login to server with root privileges and try to start MySQL service manually.
/etc/init.d/mysql start ....Or.....sudo /etc/init.d/mysql start[*]Check if you have already MySQL service running.
Type following command to determine if there is MySQL service running already.
ps -aux | grep mysql
If MySQL services is already running, you will get list of MySQL processes with PIDs. You will have to kill those processes.
kill -9 PID ...............where PID is the process ID of the MySQL processes.[*]Check ownership of /var/lib/mysql/
Type the following command to check ownership of MySQL service:
ls -laF /var/lib/mysql/
If it's owner is root, you should change it to MySQL or your_user.
sudo chown -R mysql /var/lib/mysql/[*]Take backup of mysql.sock file and remove it.
To achieve this, fire following commands:
cp /var/lib/mysql.sock /var/lib/mysql.sock_bkp
rm -rf /var/lib/mysql.sock
Now have a try to start MySQL service with following command:
/etc/init.d/mysql start[*]Try to find log files with suffix ".err".
You will get these files at following path. This files contain actual error messages.
In many cases, removing this error files has also fixed this issue.[*]Check if my.conf file has been modified recently.
If you wish to edit my.conf file, it is recommended to take backup so you can restore it if anything goes wrong. Additionally, you will have to be extra careful that you do not add any invalid characters or line in this file. If you notice any changes to this file, revert it from known backup you have.
Navigate to /etc/my.cnf and restore the changes you have made to this file.[*]Move the log file named