1680
MySQLERRORCommonInnoDBHIGH confidence

InnoDB IMPORT TABLESPACE failed

Production Risk

High — import fails; table remains inaccessible until the issue is resolved.

What this means

The ALTER TABLE ... IMPORT TABLESPACE operation failed because the .ibd file could not be imported, typically due to schema mismatch, corruption, or encryption issues.

Why it happens
  1. 1The .ibd file was generated from a different server version or row format.
  2. 2The .cfg metadata file is missing or does not match the .ibd file.
  3. 3The .ibd file is encrypted and the key is unavailable.
  4. 4The tablespace ID in the .ibd file conflicts with an existing tablespace.
How to reproduce
trigger — this will error
trigger — this will error
ALTER TABLE t IMPORT TABLESPACE;

expected output

ERROR 1680 (HY000): Schema mismatch (Expected FSP_SPACE_FLAGS=0x0, .ibd file contains 0x21).

Fix 1

Ensure .ibd and .cfg files are from the same export

Ensure .ibd and .cfg files are from the same export
-- On source:
FLUSH TABLES t FOR EXPORT;
-- Copy both t.ibd and t.cfg
UNLOCK TABLES;
-- On destination:
ALTER TABLE t DISCARD TABLESPACE;
-- Copy files, then:
ALTER TABLE t IMPORT TABLESPACE;

Why this works

Using matched .ibd and .cfg files from a FLUSH TABLES FOR EXPORT ensures consistency.

Fix 2

Verify destination table schema matches source

Verify destination table schema matches source
SHOW CREATE TABLE t;

Why this works

The destination table definition must exactly match the source for a successful import.

What not to do

Sources
Official documentation ↗

MySQL 8.0 — 1680 ER_INNODB_IMPORT_ERROR

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

← All MySQL errors