Immediate Fix: Using InnoDB Force Recovery
When MySQL stops responding due to InnoDB corruption, the primary goal is to start the service in a read-only state to rescue your data. This is achieved using the innodb_force_recovery parameter.
Step 1: Edit the MySQL Configuration
Locate your MySQL configuration file (usually my.cnf or my.ini) and add the following line under the [mysqld] section:
[mysqld]
innodb_force_recovery = 1
Start with a value of 1. If the service fails to start, increment the value slowly up to 6. Note that values above 4 can permanently corrupt data files, so use them only as a last resort.
Step 2: Export Data and Rebuild
Once the server starts, immediately export your databases using mysqldump. After the export is complete, remove the recovery line from your config, delete the corrupted data files, and restore from the dump.
mysqldump -u root -p --all-databases > alldata_backup.sql
Technical Explanation: Why InnoDB Corrupts
InnoDB corruption typically occurs when the database engine cannot maintain ACID compliance. This is often triggered by sudden power loss, hardware failure (specifically disk controller issues), or operating system crashes that prevent the “Doublewrite Buffer” from completing its task.
When MySQL restarts, it attempts to perform crash recovery by replaying the ib_logfile entries. If the log files or the tablespace (ibdata1) contain torn pages or inconsistent checksums, the engine will crash to prevent further data integrity loss.

Alternative Methods
If forcing recovery does not resolve the issue, or if you only have specific tables that are corrupted, consider the following alternative approaches.
| Method | Use Case | Risk Level |
|---|---|---|
| Restore from Backup | Full database failure with recent SQL dumps available. | Low |
| Percona Data Recovery Tool | Recovering rows directly from corrupted .ibd files. | High |
| DROP and Rebuild Index | Corruption limited to non-primary indexes. | Medium |
| Transportable Tablespaces | Attaching orphan .ibd files to a fresh MySQL instance. | Medium |
For minor corruption, you may try the CHECK TABLE command. However, for InnoDB, this command usually reports the error rather than fixing it. If the error is persistent, the “Dump and Reload” method remains the industry standard for a clean fix.
CHECK TABLE table_name;