Diagnose and Repair Corrupted MySQL Tables

Last updated: August 28, 2026.

The correct response depends on the storage engine and failure. Preserve evidence and backups before attempting repair; an operation appropriate for MyISAM is not the normal recovery path for InnoDB.

Identify and check the table

SELECT TABLE_SCHEMA, TABLE_NAME, ENGINE
FROM information_schema.TABLES
WHERE TABLE_SCHEMA = 'appdb' AND TABLE_NAME = 'orders';

CHECK TABLE appdb.orders;

Choose the recovery path

  • For InnoDB, inspect the server error log and use documented recovery or restore procedures.
  • For MyISAM, use CHECK TABLE and supported repair tools only with a backup.
  • Correct failing storage or filesystem conditions first.
  • Restore to another location when preservation matters.
  • Verify row counts, constraints, and application queries afterward.

Reference: MySQL 8.4 table maintenance reference.

admin

admin