3396
MariaDBERRORNotableInnoDB / TablespacesHIGH confidence
Table already exists in the specified tablespace
Production Risk
Low — DDL fails; no data is moved.
How to reproduce
trigger — this will error
trigger — this will error
ALTER TABLE t TABLESPACE ts1;
expected output
ERROR 3396 (HY000): Table already exists in tablespace.
Fix
Check for existing tables in the tablespace
Check for existing tables in the tablespace
SELECT TABLE_NAME, TABLESPACE_NAME FROM INFORMATION_SCHEMA.INNODB_TABLES WHERE TABLESPACE_NAME = 'ts1';
Why this works
Lists all tables in the target tablespace so conflicts can be identified and resolved.
What not to do
✕
Sources
Official documentation ↗
MySQL 8.0 — 3396 ER_TABLE_ALREADY_EXISTS_IN_TABLESPACE
Content generated with AI assistance and reviewed for accuracy. Found an error? hello@errcodes.dev