<p>MySQL cannot locate the physical tablespace file (.ibd) for the referenced table, halting queries and startup.</p>
<p>MySQL Error 1812 ER_TABLESPACE_MISSING appears when the server cannot find the .ibd tablespace file for a table. Recover or recreate the file, then run ALTER TABLE ... IMPORT TABLESPACE or restore from backup to resolve the error.</p>
Tablespace is missing for table %s.
MySQL raises Error 1812 when it cannot locate the tablespace file that stores a table’s data. The .ibd file referenced in the data dictionary is missing, unreadable, or located in a different path.
The error surfaces at server startup, during SELECT, INSERT, UPDATE, DELETE, or while running DDL such as ALTER TABLE. Fixing it quickly restores data availability and avoids further corruption.
Deleting or renaming the .ibd file outside MySQL is the most common trigger. InnoDB still expects the file and fails when it is gone.
Moving the data directory without updating innodb_data_home_dir or symbolic links breaks the file path and produces Error 1812.
Server crashes, disk failures, or permission changes can also make the tablespace unreadable, causing MySQL to mark it as missing.
First confirm whether the .ibd file exists in the database directory. If present, correct ownership and permissions so the mysqld user can access it, then run FLUSH TABLES or restart MySQL.
If the file is absent, restore it from a backup or snapshot. Copy the file into the correct directory and execute ALTER TABLE tbl IMPORT TABLESPACE to reattach it.
When no backup exists, recreate the table using CREATE TABLE and reload data from logical dumps or application exports.
Accidental deletion: recover the .ibd file from filesystem snapshots, then run DISCARD and IMPORT TABLESPACE.
Path mismatch after data directory move: update my.cnf paths, run mysql_upgrade, and restart.
Replication stop: copy the missing tablespace from the source server and import it on the replica before restarting replication.
Enable innodb_file_per_table and always move or rename tables with ALTER TABLE, not shell commands.
Schedule daily hot backups with tools like Percona XtraBackup and store copies off-server.
Lock down filesystem permissions to prevent accidental deletion and monitor the error log for 1812 events via Galaxy or your observability platform.
Error 1146 Table doesn’t exist - occurs when the table definition is missing from the data dictionary.
Error 1030 Got error 35 from storage engine - a generic OS-level access failure that can precede 1812.
Error 1932 Table was created with a different version - surfaces during IMPORT when internal IDs mismatch.
Removing the tablespace file from the filesystem leaves the data dictionary entry orphaned and triggers Error 1812.
Changing innodb_data_home_dir or symbolic links without moving files causes MySQL to look in the wrong location.
Disk corruption or power loss can render the tablespace unreadable at server startup.
The table definition is missing, not just the tablespace file.
Indicates generic OS-level failure accessing InnoDB files.
Appears during table import when metadata versions differ.
Yes. Importing the recovered .ibd file while holding a brief metadata lock keeps downtime minimal.
It helps by isolating each table, limiting damage and simplifying recovery.
Recreate the table schema and reload data from the dump to restore functionality.
Galaxy tracks DDL history, encourages ALTER TABLE over filesystem edits, and alerts you when mysqld logs Error 1812.