How to check and repair MySQL database tables


In case you stumble across an error like: “Table ‘table_name’ is marked as crashed and should be repaired”, you’ll need to do the following:

cPanel

In cPanel, you can repair a database table by:

cPanel -> Databases -> MySQL Databases

You may need to go to Page 2, so under Current Databases [2] or >> to go to the next page.

Under Modify Databases click [Check DB] or [Repair DB].

 

Plesk

Open the database in phpMyAdmin. To do that, go to your Plesk control panel, click “Websites and Domains,” click “Databases,” and then click the database in question. From there, click “Webadmin” under “Tools.” You will most likely be presented with phpMyAdmin.

Next, click “Databases” in the upper right, click the database name, then scroll all the way down and click “Check All” to check all the tables. From the drop down menu, select “Check Tables” and your tables will immediately be checked. After that, you can decide which tables to select and choose “repair” from the drop down menu.

 

Linux Command Line

Log into the MySql command line tool using the following command and then enter the MySql password.

# mysql -u username -p databasename
# password: ********
mysql> check table tablename;
mysql> repair table tablename;

After the table has been repaired, type 'exit' to quit the command line tool.

mysql> exit
bye

This article has been provided by Codero Hosting, the leading provider of reliable dedicated, managed and cloud hosting services. Need more information on this topic or to learn more about Codero’s hosting services please visit 
www.codero.comchat with us online or give us a call at 866-2-CODERO.
Posted in
Last update:
2015-12-03 20:39
Average rating:0 (0 Votes)