Symptoms
MySQL/MariaDB is down and is unable to be started.
Description
Due to space issues or if a server is powered off/halted, a database table may be in a corrupted state. In a situation where the mysql database has a corrupt table like mysql.user MySQL will not start due to corruption. That error seen would be the following depending on the table:
[Server] Table './mysql/table_name' is marked as crashed and should be repaired
Workaround
Typically, you can repair user databases while MySQL/MariaDB is running using "Home » SQL Services » Repair a MySQL® Database" in WHM. In this situation, the MySQL service isn't running, and the table needs to be repaired manually.
- Confirm the table is corrupt by running the following:
myisamchk -s /var/lib/mysql/mysql/$table_name
Please note: "$table_name" must be replaced with the table name for the command to work. - If the table is corrupted, it can be repaired using the following command:
myisamchk -r --update-state /var/lib/mysql/mysql/$table_name
Please note: "$table_name" must be replaced with the table name for the command to work.
Please note that cPanel, LLC only supports the cPanel-provided software and does not provide general system administration services. Therefore, you may wish to seek assistance from a qualified server/systems administrator to perform these tasks.
Comments
0 comments
Article is closed for comments.