3401
MySQLERRORNotableInnoDB / TablespacesHIGH confidence
Cannot change tablespace type
Production Risk
Low — DDL fails; no data is moved.
How to reproduce
trigger — this will error
trigger — this will error
ALTER TABLESPACE ts1 TYPE = SYSTEM;
expected output
ERROR 3401 (HY000): Cannot change tablespace type.
Fix
Migrate tables to a new tablespace of the desired type
Migrate tables to a new tablespace of the desired type
CREATE TABLESPACE new_ts ADD DATAFILE 'new_ts.ibd'; ALTER TABLE t TABLESPACE new_ts; DROP TABLESPACE ts1;
Why this works
Creating a new tablespace and migrating tables is the only way to change tablespace type.
What not to do
✕
Sources
Official documentation ↗
MySQL 8.0 — 3401 ER_CANNOT_CHANGE_TABLESPACE_TYPE
Content generated with AI assistance and reviewed for accuracy. Found an error? hello@errcodes.dev