We use cookies to understand how you interact with our site, to personalize and streamline your experience, and to tailor advertising. By continuing to use our site, you accept our use of cookies and accept our Privacy Policy.
Only
--:--:--
left to get 75% OFF Nexcess premium managed hosting
Shop plans
Contact Us
Contact Us
Sign in
Sign in
Nexcess Logo

How to Repair MySQL Tables

September 10, 2019

If you encounter MySQL time-out errors or unexpected restarts, the likely cause is one or more crashed database tables. Repairing the crashed tables will likely solve the issue, though this may cause the loss of some data.

If you are uncomfortable with losing data, then using a recent database dump to restore the database may mitigate this loss. However, if the date of your last database dump is not recent, it can result in greater data loss than simply repairing the table.

Attention

This method only applies to Nexcess clients on physical (non-cloud) servers. If you are a Nexcess Cloud client, contact our 24/7 support team for assistance.

Repairing Crashed Tables With phpMyAdmin

You can access phpMyAdmin from your SiteWorx account:

1. Log in to your SiteWorx account.

  • If you do not know your password, click Forgot your password on the login page.
  • If you do not know the web address for your SiteWorx login page, either refer to your Welcome Email or contact our 24-hour support team for assistance.

2. On the left, select Hosting Features > MySQL > PhpMyAdmin.

To repair MySQL tables with phpMyAdmin, select MySQL > PhpMyAdmin

3. Select the correct database from the list on the left.

To repair MySQL tables, select the correct database in phpMyAdmin

4. Select the check box corresponding to the corrupted table, and from the With selected list, click Repair table.

Click on repair table within phpMyAdmin

Repairing Crashed Tables With the MySQL CLI

Use this procedure to repair MySQL tables from the command line.

1. Log in to the server using SSH.

2. From the command line, enter this command, replacing [username] with your username and without the brackets:

mysql -u [username] -p

3. Enter your password.

4. Again, without the brackets, enter the command:

use [databasename];

5. Enter the command:

show tables;


6. Unlike phpMyAdmin, there is no way to repair multiple tables with one command. Instead, you must issue one command per table:

To check a table for errors, enter:

check table [yourtablename];

To repair a table, enter:

repair table [yourtablename];

7. Type quit to return to the command prompt.

Now You Know

For the complete MySQL documentation, see the MySQL development website.

Try Hosting With Nexcess

There are many reasons to choose Nexcess as your hosting provider. We’ve optimized hosting for the industry’s leading commerce and content platforms.

Get faster speeds on Nexcess servers and with our fully managed hosting plans.

Check out our offerings or reach out to get started today.

Jason Dobry