Home » Msyql » Check Optimize, Analyze and Repair tables in database.

Check Optimize, Analyze and Repair tables in database.

If you are experiencing in error/warning in particular mysql table in a database or specific table is corrupted the perform the below command to check and repair the table.

#mysqlcheck -c databasename tablename -u root -p

To check all tables in database.

#mysqlcheck -c databasename -u root -p

To Analyze Tables

#mysqlcheck -a databasename -u root -p

To optimize

#mysqlcheck -o databasename -u root -p

To repair table:

#mysqlcheck -r databasename tablename -u root -p

To checks, optimizes and repairs all the corrupted table in database.

#mysqlcheck -u root -p –auto-repair -c -o databasename

To check, optimize and repair all the tables across all your databases.

#mysqlcheck -u root -p –auto-repair -c -o –all-databases

If you want to show debug info while checking the table.

# mysqlcheck –debug-info -u root -p –auto-repair -c -o databasename tablename

About

I am founder and webmaster of www.linuxpcfix.com and working as a Sr. Linux Administrator (Expertise on Linux/Unix & Cloud Server) and have been in the industry from last 7 years.

Leave a Reply

Your email address will not be published. Required fields are marked *

*
*

Time limit is exhausted. Please reload the CAPTCHA.

Categorized Tag Cloud