3121
MySQLERRORNotableDDLHIGH confidence
ALTER TABLE copy algorithm not supported for this reason
Production Risk
Medium — failed DDL leaves the schema unchanged; retry during a maintenance window.
What this means
The COPY algorithm was explicitly requested for an ALTER TABLE but cannot be used because of a specific incompatibility, such as a running online DDL operation or a conflicting table attribute.
Why it happens
- 1ALGORITHM=COPY specified but the table engine or current server state forbids it.
- 2Concurrent online DDL operations are in progress on the same table.
How to reproduce
trigger — this will error
trigger — this will error
ALTER TABLE t1 MODIFY COLUMN id BIGINT, ALGORITHM=COPY;
expected output
ERROR 3121 (HY000): ALGORITHM=COPY is not supported. Reason: ...
Fix 1
Wait for concurrent DDL to finish
Wait for concurrent DDL to finish
SHOW PROCESSLIST;
Why this works
Identify and wait for or kill conflicting DDL sessions before retrying.
Fix 2
Use the default algorithm
Use the default algorithm
ALTER TABLE t1 MODIFY COLUMN id BIGINT;
Why this works
Let MySQL choose the algorithm automatically.
What not to do
✕
Sources
Official documentation ↗
MySQL 8.0 — 3121 ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_COPY2
Content generated with AI assistance and reviewed for accuracy. Found an error? hello@errcodes.dev