MySQL raises error 1101 when a CREATE or ALTER statement assigns a DEFAULT value to a BLOB, TEXT, GEOMETRY, or JSON column, which those types cannot have.
MySQL Error 1101: ER_BLOB_CANT_HAVE_DEFAULT occurs when a CREATE or ALTER TABLE statement tries to set a default value on a BLOB, TEXT, GEOMETRY, or JSON column. Remove the DEFAULT clause or use a compatible data type to fix the issue.
BLOB, TEXT, GEOMETRY or JSON column '%s' can't have a
The exact message is: BLOB, TEXT, GEOMETRY or JSON column '%s' can't have a default value. MySQL throws it while parsing a CREATE TABLE or ALTER TABLE statement.
The server blocks DEFAULT on these large object types because their size and storage characteristics make implicit initialization unsafe.
Before MySQL 8.0.13, even expression defaults were disallowed, so the error commonly appears on older versions.
Assigning a literal DEFAULT ('') or DEFAULT 0 to any column defined as BLOB, TEXT, JSON, or GEOMETRY immediately triggers the error.
Running a migration file generated by ORMs that assume all NOT NULL columns need DEFAULT values often leads to the problem.
Upgrading schemas from other databases where LOB columns allow defaults can introduce incompatible DDL into MySQL.
Remove the DEFAULT clause from the problematic column and re-run the DDL.
MySQL automatically sets such columns to NULL unless you supply data during INSERT.
If you must auto-populate the column, create a BEFORE INSERT trigger or switch to VARBINARY or VARCHAR with an explicit length that supports defaults.
CI/CD pipelines fail because an ORM adds DEFAULT '' to longtext fields. Configure the ORM to skip defaults for BLOB/TEXT types.
A migration converts VARCHAR(255) to TEXT DEFAULT ''.
Split the step: first drop DEFAULT, then change the data type.
Developers on MySQL 8.0.19 try DEFAULT (CONVERT('{}' AS JSON)) for JSON columns.
Ensure sql_mode includes ALLOW_INVALID_DATES and use DEFAULT (json_object()) instead.
Define BLOB/TEXT/JSON columns as NULLABLE unless application logic guarantees a value at insert time.
Use generated columns or triggers instead of DEFAULT values when you need automatic initialization of LOB data.
Error 1108 ER_WRONG_FIELD_SPEC occurs when DEFAULT is placed before the column definition.
Move DEFAULT after the data type.
Error 1067 Invalid default value arises when DATE or TIMESTAMP defaults are not literal constants. Ensure the default follows MySQL rules.
.
No. The MySQL storage engine disallows literal defaults for BLOB and TEXT types. Use triggers or generated columns instead.
Yes, starting with 8.0.13 you can use DEFAULT (expression) for JSON, but literal defaults still raise the error.
Your local MySQL version may allow expression defaults while CI runs an older release. Align server versions or remove the DEFAULT clause.
Galaxy's context-aware AI copilot flags illegal DEFAULT clauses in real time and suggests compliant DDL, preventing failed deployments.