How to Check and repair a corrupted MySQL database on CentOS server using SSH
1- Login Via ssh
Run this command
mysqlcheck -r [your-database-name]
Here, mysqlcheck command will check the database.
-r will repair the corrupted tables of the database.
If above command is not working
Then Run
myisamchk -r / var / lib / mysql / [your-database-name] / *
Here, you should keep this thing in mind that MyISAM is the default storage engine for MySQL.
myisamchk command will check the database.
-r will repair the corrupted tables of the database.
Auto repair a corrupted database
- Execute the following command:
mysqlcheck -A --auto-repair
(-A = check all accounts)