How to repair a crashed MySQL table/database

How to repair a crashed MySQL table/database

Symptoms: If your site/application is displaying something similar to:



Table './user_dbname/dbprefix_table' is marked as crashed and should be repaired



Resolution:



1. Access phpMyAdmin (link can be found in your control panel under Database -> MySQL -> MySQL Databases -> DB Name)

2. Select the database with the affected table from the pulldown list on the left side of the screen.

3. Click on the "SQL" tab on the right side of the screen

4. Type in the following and click "Go":



repair table tablename-to-be-repaired;



This will run a repair against just that table.



For a GUI method (and to repair multiple tables), please see http://paulstamatiou.com/how-to-quickie-repair-mysql-tables-in-phpmyadmin
    • Related Articles

    • How to repair a DB on MySQL

      REPAIR TABLE & Database On MySQL ============================== The REPAIR TABLE method is only applicable to MyISAM, ARCHIVE, and CSV tables. You can use REPAIR TABLE if the table checking operation indicates that there is a corruption or that an ...
    • MySQL

      MySQL     Log into MySQL: mysql -uUSERNAME -p'PASSWORD' List Users: SELECT User FROM mysql.user; Create & Modify Users: CREATE USER 'newuser'@'localhost' IDENTIFIED BY 'password'; GRANT ALL PRIVILEGES ON * . * TO 'newuser'@'localhost'; Once you have ...
    • Reset mysql password

      First try to see if you can login to mysql as root. ssh to root user, or su root from AD login.       mysql If you get an error similar to: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) Then the password is ...
    • How do I backup a MySQL database?

      Backing up your MySQL database can be done couple different ways. Method #1 Using the phpMyAdmin web interface included in the Hsphere CP Method #2 Using command line utility "mysqldump" Using the phpMyAdmin Method: To access phpMyAdmin, you will ...
    • MYSQL basic user permissions

       Grant Different User Permissions On a MYSQL database. Here is a short list of other common possible permissions that users can enjoy. ALL PRIVILEGES- as we saw previously, this would allow a MySQL user all access to a designated database (or if no ...