How to repair MySQL tables

Configurare noua (How To)

Situatie

How Nexcess clients on physical (non-cloud) accounts can repair crashed MySQL tables using either phpMyAdmin or the MySQL CLI.

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.

Solutie

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.

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

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

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:
    1. To check a table for errors, enter:
      check table [yourtablename];
    2. To repair a table, enter:
      repair table [yourtablename];
  7. Type quit to return to the command prompt.

Tip solutie

Permanent

Voteaza

(16 din 26 persoane apreciaza acest articol)

Despre Autor

Leave A Comment?