How to Fix the Common MySQL Errors?
Posted on August 17th, 2018
In this tutorial, we can discuss the most common MySQL errors that can be happened on your server and the possible fixes. If you are getting the “error establishing a database connection” error for all your website, then login to your server via ssh and check the MySQL service status. You can check the MySQL status by executing the following command:
# service mysql status
If MySQL is down, then execute the following command to start the MySQL service.
# service mysql start
Starting MySQL.. ERROR! The server quit without updating PID file (/var/lib/mysql/server.pid).
In case you got the error again like “ERROR! The server quit without updating PID file, the try to find out all the currently running MySQL processes by sing the command given below:
Then kill all MySQL process.
# ps -ef | grep mysql
After you have found the MySQL processes, kill all of them
# Kill -9 PID
If the error still persists, try to move ib_log files to /tmp folder and try to start the MySQL service.
# mv /var/lib/mysql/ib* /tmp
Then try to start the MySQL service.
# service mysql start
If you check the MySQL error log and could see the below error, then please follow the below steps.
Check the MySQL error log in /var/lib/mysql/
mysqld started
[ERROR] /usr/sbin/mysqld: Table ‘./mysql/user’ is marked as crashed and should be repaired
[ERROR] /usr/sbin/mysqld: Table ‘./mysql/user’ is marked as crashed and should be repaired
[ERROR] Fatal error: Can’t open and lock privilege tables: Table ‘./mysql/user’ is marked as crashed and should be repaired mysqld ended
Then first try the below command.
# /scripts/mysqlup –force
In case you got the same error then try to start MySQL using the below command.
# service MySQL start –skip-grant-tables
Then repair the corrupted table using the command.
# cd /var/lib/mysql/mysql
# mysqlcheck -r mysql user
mysql.user
warning : Number of rows changed from 1558 to 1556
status : OK
Now its repaired, restart mysql.
root@ [/var/lib/mysql/mysql]# service mysql stop
Shutting down MySQLs [ OK ]
root@ [/var/lib/mysql/mysql]# service mysql start
Starting MySQL [ OK ]
You can also restart the MySQL service from WHM.
1) Login to WHM.
2) Navigate to Restart Services.
3) Now you can restart the MySQL service by clicking the icon “SQL Server(MySQL)”.
If you need any further assistance please contact our support department.
I have a GoDaddy VPS server and my site is in live .
But some of the Tab is not working it’s showing DataBase Error.
We find an issue in the Mysql setting . The issue is in the setting, If we changed the setting to what required, after 1 or 2 weeks it’s changing to the previous stage so it’s showing a DB error.
These are the big issues that cause my business .
Feel free to contact our Live Chat support from https://www.interserver.net/ and our support team will be able to assist you with any service you have ordered through us.