MySQL stopped running due to improper shutdown or abrupt close of the query. To start the MySQL service, please use the following reasons and solutions.
# servicemysql status
MySQL is not running, but lock file (/var/lock/subsys/mysql[FAILED]
Above command will shows that the MYSQL is not running. We have ran following command to remove the lock file.
# rm /var/lock/subsys/mysql
Then, we restarted the MySQL service using the following command:
# servicemysqld restart
This fixed the error.
The other reason for this error to occur is due to the database tables crashing. Normally, the following message displays in the MySQL error logs.
MyISAM-table ‘/var/lib/mysql/dbname/table_name.MYI’ is marked as crashed and should be repaired
We can fix this problem by repairing the database and the database tables using the below commands:
# myisamchk<database><server>
# mysqlcheck -r <database><postname>
Restart the MySQL service using the command.
# servicemysqld restart
Now MySQL will started.
At Velan, our server support engineers can help you resolve MySQL not working issues on cPanel. We troubleshoot problems like these for our clients every day. If you are interested in our service, please fill the Quick connect form to get in touch with us