MySQL 8.0 fails to start after abrupt power loss: InnoDB reports missing .ibd and tablespace id mismatch
Environment
Single MySQL 8.0 instance on Ubuntu 20.04 using InnoDB file-per-table (innodb_file_per_table=ON), dataset stored on an ext4 partition, server experienced sudden power loss during heavy write activity; no recent logical backups taken, but nightly filesystem-level snapshots exist from the host.
Symptoms
After power outage the MySQL service does not come online; mysqld logs show repeated InnoDB errors referencing missing .ibd files and 'Tablespace id mismatch' followed by mysqld aborting; attempting to start with default configuration exits before networking is available.
Observations
Mysqld error log contains lines like 'InnoDB: Tablespace id mismatch' and 'InnoDB: Could not find .ibd file for table dbname/tablename', trying to start with innodb_force_recovery=1..6 allows server binary to start in read-only modes at force_recovery >=4, but many queries fail or return NULL; the underlying ext4 partition shows no reported corruption by fsck and the .ibd files are present for some tables while missing for others.
Already attempted
Tried incremental recovery with innodb_force_recovery values starting at 1 and increasing; copied datadir to a separate directory before tests; ran mysqlcheck against tables when server started with high force_recovery but it returned errors; verified filesystem integrity with sudo fsck -n; tried to import a .sql dump but mysqld would not run reliably without force_recovery.
Question
What safe, reversible recovery strategy should I use to restore as many InnoDB tables as possible without worsening corruption, and what are the recommended steps to export data when mysqld will only start with innodb_force_recovery enabled?
Verified community troubleshooting
No answers yet..