MySQLMySQL 1264
MySQL 1264: Out of Range Value for Column
MySQL 1264 is raised in strict mode when a numeric value being stored exceeds the maximum or falls below the minimum value allowed for the column's data type.
Example Query
CREATE TABLE products (stock TINYINT UNSIGNED); INSERT INTO products (stock) VALUES (300); -- TINYINT UNSIGNED max is 255
Common Causes
- 1Inserting a value larger than the column's numeric type allows
- 2TINYINT (max 127) or SMALLINT (max 32767) too small for the data
- 3Negative value inserted into an UNSIGNED column
How to Fix It
Choose an appropriately sized integer type (INT, BIGINT). Check ranges: TINYINT 0–255 unsigned, INT 0–4294967295 unsigned. In non-strict mode MySQL silently clamps values — enable strict mode to catch these early.
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 →