Hello,


I have huge database for my website. Almost all the database has corrupted. I wasn’t able to connect my website properly neither i was able to fix it manually. Can any one help me to fix the issue???


Solution: If your MySQL table is corrupted or damaged, then just follow this command to repair the mysql table following with the extension.


=======

myisamchk -r *.MYY to repair msql
=======


Understanding the command:

myisamchk – this is the command can be used to repair MySQL 
                    database tables.
-r               – recursive  function to perform the repair task
*.               – * represents all the names before the (.) has to be
                      taken for the database repair.
.MYY          – .MYY represents the mysql  database table extension. 
                     we can change the extention

2 thoughts on “MySQL table repair”

  1. MySQL tables can also repaired in the following way:

    mysql> use dtabase(ie in which database the table is includeed)

    mysql> REPAIR TABLE `tbl_name` to fix it!

  2. Hi Guys, It is better and safer to repair the DB/Table via WHM/cPanel.

    If you want repair DB using myisamchk, you need to shutdown MySQL service before proceeding otherwise it will corrupt some other databases.

    Alternatively, if you do not want to shut down MySQL, you can use mysqlcheck.
    mysqlcheck [DBNAME]
    To repair the database tables:
    mysqlcheck -r [DBNAME]

    Correct me if I am wrong:P
    Happy Troubleshooting 🙂

Leave a Reply