Skip to main content

Corruption and Repairs

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

MySQL Corruption

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

MySQL Check

mysqlcheck -options database

MySQL Check Options:

-cChecks tables for errors. It performs a CHECK TABLE operation on each table in the specified databases.
-rAttempts to repair corrupted tables. It performs a REPAIR TABLE operation on each corrupted table.
-aAnalyzes tables for optimal performance. It performs an ANALYZE TABLE operation on each table.
-oOptimizes tables to reduce fragmentation and reclaim unused space. It performs an OPTIMIZE TABLE operation on each table.
--databases db1 db2 Checks and repairs tables in multiple databases (db1 and db2).
-AChecks and repairs tables in all databases foron issuesthe

MySQL server.

Mysqlcheck==================================================================================== –A 

 

Repair all databases 

Mysqlcheck -Ar