MySQLMySQL 1265
MySQL 1265: Data Truncated for Column
MySQL 1265 is a warning (elevated to error in strict mode) indicating that the inserted value was truncated to fit the column definition. This is common with ENUM columns receiving an unlisted value.
Example Query
CREATE TABLE t (status ENUM('active','inactive'));
INSERT INTO t (status) VALUES ('pending');
-- 'pending' is not in the ENUM listCommon Causes
- 1Inserting a value not listed in an ENUM or SET column
- 2String longer than the column's VARCHAR or CHAR size in non-strict mode
- 3Numeric value out of range for the column type
How to Fix It
Add the missing value to the ENUM definition: ALTER TABLE t MODIFY status ENUM('active','inactive','pending'). Validate data against allowed values before inserting. Consider using a lookup/reference table instead of ENUM for easier extensibility.
Need a reliable database?
Try Supabase — free PostgreSQL with a generous free tier. No credit card required.
Got a query causing this error?
Paste it into SQLbuddy and get an instant plain-English explanation with optimization tips.
Analyze My Query →