FULL AI ANALYSIS

MySQL 8.0 fails to start after abrupt power loss: InnoDB reports missing .ibd and tablespace id mismatch

Generated Oct 3, 2026, 12:35:03 AM

Analysis summary

Abrupt power loss during heavy writes can cause InnoDB tablespace metadata and .ibd files to become inconsistent or partially written, resulting in tablespace id mismatches and missing file errors. innodb_force_recovery is useful to get the engine to a read-only state for extracting data, but higher recovery levels disable many InnoDB operations and risk producing incomplete exports. The presence of some .ibd files but missing others suggests either file-level deletion, filesystem-level write ordering issues, or that the InnoDB internal data dictionary refers to tablespaces that were not flushed to disk before the crash.

Possible causes

Incomplete flush of InnoDB tablespace metadata to disk at power loss causing internal dictionary mismatch

90%

Cached writes in the OS or controller not persisted leading to inconsistent state

85%

Hardware issues with the storage device (controller, power) during heavy I/O

60%

Accidental deletion or filesystem-level corruption of .ibd files for some tables

40%

Suggested fixes

1

Diagnostic step 1

Immediately make a full block-level copy of the MySQL datadir and all related files (using dd or LVM snapshot) and work only on copies; do not attempt in-place aggressive repairs.

2

Diagnostic step 2

Start mysqld on the copy with progressively higher innodb_force_recovery values (1 → 6) only until the server is stable enough to export data; prefer the lowest level that allows SELECTs.

3

Diagnostic step 3

When mysqld is readable, perform logical exports (mysqldump with --single-transaction where possible) starting with smaller, critical tables; verify exported SQL for completeness.

4

Diagnostic step 4

If logical export is impossible for specific tables, consider per-table tablespace import/export techniques: create a matching empty table on a healthy server, discard its tablespace, copy the .ibd file (if present and consistent), then attempt ALTER TABLE IMPORT TABLESPACE — only after careful backups and understanding of matching metadata requirements.

5

Diagnostic step 5

If .ibd files are missing or metadata is corrupted beyond logical export, escalate to a MySQL/InnoDB recovery specialist or consider commercial data-recovery services; preserve original copies and recovery attempts for specialist analysis.