3214
MariaDBERRORCommonInnoDB / StorageHIGH confidence

Named tablespace is missing

Production Risk

Critical — all tables in the tablespace are inaccessible.

Why it happens
  1. 1A named InnoDB tablespace referenced in the data dictionary no longer has a corresponding file.
  2. 2Tablespace was created with CREATE TABLESPACE and its file was subsequently removed.
How to reproduce
trigger — this will error
trigger — this will error
SELECT * FROM t1; -- t1 uses a named tablespace whose file is gone

expected output

ERROR 3214 (HY000): Tablespace 'ts1' is missing.

Fix 1

Restore the tablespace file

Restore the tablespace file
-- Copy the .ibd or .ibdata file back to the datadir.

Why this works

InnoDB can reopen the tablespace once the file is present.

Fix 2

Drop and recreate the tablespace

Drop and recreate the tablespace
DROP TABLESPACE ts1; CREATE TABLESPACE ts1 ADD DATAFILE 'ts1.ibd';

Why this works

Only viable if data loss is acceptable.

What not to do

Sources
Official documentation ↗

MySQL 8.0 — 3214 ER_TABLESPACE_MISSING_WITH_NAME

Content generated with AI assistance and reviewed for accuracy. Found an error? hello@errcodes.dev

← All MariaDB errors