1676
MariaDBERRORCommonInnoDBHIGH confidence
Tablespace file is missing
Production Risk
Critical — the table is completely inaccessible without the tablespace file.
What this means
InnoDB cannot find the .ibd tablespace file for a table. The file was deleted, moved, or never created.
Why it happens
- 1The .ibd file was manually deleted from the data directory.
- 2The data directory was moved or restored without including all .ibd files.
- 3The table was created on one server and the data directory was copied incompletely.
How to reproduce
trigger — this will error
trigger — this will error
SELECT * FROM t; -- .ibd file missing
expected output
ERROR 1676 (HY000): Tablespace for table 'mydb/t' is missing.
Fix 1
Restore the .ibd file from backup
Restore the .ibd file from backup
-- Stop MySQL -- Copy the .ibd file from backup to the data directory -- Start MySQL
Why this works
Restoring the tablespace file allows InnoDB to access the table again.
Fix 2
Drop and recreate the table if no backup is available
Drop and recreate the table if no backup is available
DROP TABLE IF EXISTS t; CREATE TABLE t (...);
Why this works
If data loss is acceptable, recreating the table resolves the missing tablespace.
What not to do
✕
Sources
Official documentation ↗
MySQL 8.0 — 1676 ER_TABLESPACE_MISSING
Content generated with AI assistance and reviewed for accuracy. Found an error? hello@errcodes.dev