# InnoDB：磁盘上的数据库页损坏或页面文件读取失败 [页 id：space=123, page number=456]。您可能需要从备份中恢复。

- **ID:** `database/mysql-innodb-redo-log-corruption`
- **领域:** database
- **类别:** data_error
- **验证级别:** ai_generated
- **修复率:** 70%

## 根因

InnoDB 检测到数据页的校验和不匹配，表明 ibd 文件物理损坏或由于硬件问题（例如，坏磁盘扇区、内存损坏）导致读取失败。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| MySQL 8.0 | active | — | — |
| MySQL 8.4 | active | — | — |
| Percona Server 8.0 | active | — | — |

## 解决方案

1. ```
   Set innodb_force_recovery to a value between 1 and 6 in my.cnf, then restart MySQL to bypass the corruption and dump the table: mysqldump -u root mydb my_table > dump.sql. After dump, drop and recreate the table, then restore. Example: innodb_force_recovery = 4.
   ```
2. ```
   Restore the affected table from a recent backup using mysqlbinlog or physical backup (e.g., Percona XtraBackup). Example: xtrabackup --prepare --target-dir=/backup; then copy the restored ibd file to the datadir.
   ```

## 无效尝试

- **Restart MySQL without any recovery steps, hoping the corruption is transient** — InnoDB will attempt to read the corrupted page again during startup or on access, causing the same error or a crash. (95% 失败率)
- **Run REPAIR TABLE on the affected table** — REPAIR TABLE only works for MyISAM tables; for InnoDB, it returns 'The storage engine for the table doesn't support repair'. (100% 失败率)
