There may be times when troubleshooting your website that you need to check and repair tables in your database, as they may have become corrupt.

Before continuing, be sure that you make a backup of the database you are working with in the event this does not resolve your issue.

How to check your tables

  1. Log into your cPanel
  2. Click the phpMyAdmin icon
  3. Choose the database you are working with by clicking on it in the left menu
  4. On the right side of the page, you will see a listing of your tables. Click "Check All" and then from the drop down choose "Check Table"
    how to check tables in phpMyAdmin
  5. The page will refresh and give you a summary of table that may be corrupted. As you can see from the screenshot below, all the tables are OK. If you receive any errors, you can continue reading to find how to repair your tables.
    after checking tables in phpMyAdmin

How to repair your tables

  1. Log into your cPanel
  2. Click the phpMyAdmin icon
  3. Choose the database you are working with by clicking on it in the left menu
  4. On the right side of the page, you will see a listing of your tables. Click "Check All" and then from the drop down choose "Repair Table"
    how to repair tables in phpMyAdmin
  5. The page will refresh and give you a summary of the tables that were repaired.
Did you find this article helpful?

We value your feedback!

Why was this article not helpful? (Check all that apply)
The article is too difficult or too technical to follow.
There is a step or detail missing from the instructions.
The information is incorrect or out-of-date.
It does not resolve the question/problem I have.
How did you find this article?
Please tell us how we can improve this article:
Email Address
Name

new! - Enter your name and email address above and we will post your feedback in the comments on this page!

Like this Article?

Related Questions

Here are a few questions related to this article that our customers have asked:
Ooops! It looks like there are no questions about this page.
Would you like to ask a question about this page? If so, click the button below!
Ask a Question
n/a Points
2014-04-28 4:14 pm

Does ANYONE know how to set-up a cron job in order to perform database checks and/or repair?  I have searched on this for hours and NOTHING is working with InMotion. 

Thanks.

Staff
15,308 Points
2014-04-28 4:41 pm
Hello Jason,

The basic command structure you need to run that is below:
mysqlcheck -r userna5_wrdp1 -u userna5_wrdp1 -pPassWordHere

userna5 - replace with your database username

wrdp1 - replace with your wordpress database name.

PassWordHere - replace with your database user's password


Be sure to follow the instructions from our article on how to run a cron job for it to run properly.

Kindest Regards,
Scott M
n/a Points
2014-04-28 4:48 pm

Well, there is a bit of CRITICAL information missing in your reply. It's not simply "-pPasswordHere" it MUST be --password='PasswordHere'  The password MUST be in single quotes, not in brackets or double-quotes. So, for anyone else like me out there here it is:

mysqlcheck -u CPANELNAME_DBUSER --password='DBPassword' --auto-repair --optimize --all-databases

In place of CPANELNAME_DBUSER you can also use your WHM username, it works as well I have found.

I tried many others and this is the one that works with InMotion.

Jason

Staff
9,521 Points
2014-04-29 1:57 pm
Hello Jason, and thanks for your comment.

Sorry for the lack in clarification, while typing in -pPasswordHere, you literally have a -p then no space, then your password. You can also just leave the password option off altogether and it will prompt you for one, but that wouldn't be ideal for a cronjob. I'm guessing you might have a character such as a ! in your password possibly causing the shell to interpret it as another command, so that's why only using quotes works in your case.

The long hand form that you've mentioned also works, so thanks for pointing that out as well. Here is the part when you do a man mysqlcheck on the server about the command itself and how it functions:

The password to use when connecting to the server. If you use the short option form (-p), you cannot have a space between the option and the password. If you omit
the password value following the --password or -p option on the command line, mysqlcheck prompts for one.


Thanks again!

- Jacob

Post a Comment

Name:
Email Address:
Phone Number:
Comment:
Submit

Please note: Your name and comment will be displayed, but we will not show your email address.

4 Questions & Comments

Post a comment

Back to first comment | top

Need more Help?

Search

Ask the Community!

Get help with your questions from our community of like-minded hosting users and InMotion Hosting Staff.

Current Customers

Chat: Click to Chat Now E-mail: support@InMotionHosting.com
Call: 888-321-HOST (4678) Ticket: Submit a Support Ticket

Not a Customer?

Get web hosting from a company that is here to help. Sign up today!