How to repair a DB on MySQL

How to repair a DB on MySQL

REPAIR TABLE & Database On MySQL

==============================

The REPAIR TABLE method is only applicable to MyISAMARCHIVE, and CSV tables.

You can use REPAIR TABLE if the table checking operation indicates that there is a corruption or that an upgrade is required. For example, to repair a MyISAM table, use this statement:

REPAIR TABLE t1;

mysqlcheck --repair provides command-line access to the REPAIR TABLE statement. This can be a more convenient means of repairing tables because you can use the --databases or --all-databases option to repair all tables in specific databases or all databases, respectively:

To repair a single database:
 
mysqlcheck --repair --databases db_name ...

To repair all databases:

mysqlcheck --repair --all-databases
    • Related Articles

    • 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

      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 ...
    • Uploading DB via phpmyadmin fails

      Unable to import MySQL DataBase via PhpMyAdmin. Symptoms include a hanging screen or time-out errors The cause of this is the DB file is too large to import via phpmyadmin and can only be imported via the command line by a cartikahosting.com ...
    • 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 ...