Lab-verifiedReproduced and fixed on MySQL 8.4.13 · 2026-11-29 · container image mysql:8.4
Every MySQL numeric type has a range: TINYINT goes up to 127, INT to about 2.1 billion, DECIMAL(5,2) to 999.99, and UNSIGNED types cannot be negative. ERROR 1264 means a value fell outside that range. The message names the column and the row, for example Out of range value for column 'stock' at row 1.
MySQL 8.4's default sql_mode includes STRICT_TRANS_TABLES, so the INSERT stops with an error instead of storing a clipped value. Check the column type with information_schema.columns or SHOW CREATE TABLE, then widen the type. The four runs below are the common cases.
01A TINYINT column receives a value above 127
products.stock was TINYINT. Inserting stock 300 failed with Out of range value for column 'stock' at row 1.
information_schema.columns showed tinyint. ALTER TABLE products MODIFY stock INT kept the existing row (100), and the same INSERT with 300 then succeeded.
Setup
CREATE TABLE products (id INT PRIMARY KEY, name VARCHAR(50), stock TINYINT);
INSERT INTO products VALUES (1, 'Pen', 100);Query OK, 0 rows affected (0.02 sec)
Query OK, 1 row affected (0.00 sec)INSERT INTO products VALUES (2, 'Paper', 300);ERROR 1264 (22003): Out of range value for column 'stock' at row 1SELECT column_name, column_type FROM information_schema.columns WHERE table_schema = 'lab_a' AND table_name = 'products' AND column_name = 'stock';+-------------+-------------+
| COLUMN_NAME | COLUMN_TYPE |
+-------------+-------------+
| stock | tinyint |
+-------------+-------------+
1 row in set (0.00 sec)ALTER TABLE products MODIFY stock INT;Query OK, 1 row affected (0.04 sec)
Records: 1 Duplicates: 0 Warnings: 0INSERT INTO products VALUES (2, 'Paper', 300);
SELECT * FROM products;Query OK, 1 row affected (0.00 sec)
+----+-------+-------+
| id | name | stock |
+----+-------+-------+
| 1 | Pen | 100 |
| 2 | Paper | 300 |
+----+-------+-------+
2 rows in set (0.00 sec)02DECIMAL(5,2) cannot hold 1250.00
DECIMAL(5,2) means 5 digits in total, 2 after the point, so the largest value is 999.99. 999.99 was stored, but 1250.00 failed with 1264 on column price.
ALTER TABLE prices MODIFY price DECIMAL(10,2) widened it, and the INSERT of 1250.00 succeeded.
Setup
CREATE TABLE prices (item_id INT PRIMARY KEY, price DECIMAL(5,2));
INSERT INTO prices VALUES (1, 999.99);Query OK, 0 rows affected (0.02 sec)
Query OK, 1 row affected (0.00 sec)INSERT INTO prices VALUES (2, 1250.00);ERROR 1264 (22003): Out of range value for column 'price' at row 1ALTER TABLE prices MODIFY price DECIMAL(10,2);Query OK, 1 row affected (0.04 sec)
Records: 1 Duplicates: 0 Warnings: 0INSERT INTO prices VALUES (2, 1250.00);
SELECT * FROM prices;Query OK, 1 row affected (0.00 sec)
+---------+---------+
| item_id | price |
+---------+---------+
| 1 | 999.99 |
| 2 | 1250.00 |
+---------+---------+
2 rows in set (0.00 sec)03A phone number stored in an INT column
customers.phone was INT. Inserting 821012345678 failed with 1264 because it is larger than the INT maximum.
Phone numbers are identifiers, not quantities, so the column was changed to VARCHAR(20). Inserting '821012345678' as a string then worked. A string column also keeps leading zeros.
Setup
CREATE TABLE customers (id INT PRIMARY KEY, name VARCHAR(50), phone INT);Query OK, 0 rows affected (0.02 sec)INSERT INTO customers VALUES (1, 'Kim', 821012345678);ERROR 1264 (22003): Out of range value for column 'phone' at row 1ALTER TABLE customers MODIFY phone VARCHAR(20);Query OK, 0 rows affected (0.04 sec)
Records: 0 Duplicates: 0 Warnings: 0INSERT INTO customers VALUES (1, 'Kim', '821012345678');
SELECT * FROM customers;Query OK, 1 row affected (0.00 sec)
+----+------+--------------+
| id | name | phone |
+----+------+--------------+
| 1 | Kim | 821012345678 |
+----+------+--------------+
1 row in set (0.00 sec)04A negative value in an INT UNSIGNED column
stock_moves.qty was INT UNSIGNED. Inserting -5 (a stock decrease) failed with Out of range value for column 'qty'.
If negative values are valid data, the column must be signed. After ALTER TABLE stock_moves MODIFY qty INT, -5 was stored.
Setup
CREATE TABLE stock_moves (id INT PRIMARY KEY, qty INT UNSIGNED);Query OK, 0 rows affected (0.02 sec)INSERT INTO stock_moves VALUES (1, -5);ERROR 1264 (22003): Out of range value for column 'qty' at row 1ALTER TABLE stock_moves MODIFY qty INT;Query OK, 0 rows affected (0.04 sec)
Records: 0 Duplicates: 0 Warnings: 0INSERT INTO stock_moves VALUES (1, -5);
SELECT * FROM stock_moves;Query OK, 1 row affected (0.00 sec)
+----+------+
| id | qty |
+----+------+
| 1 | -5 |
+----+------+
1 row in set (0.00 sec)FAQ
How do I find which column caused ERROR 1264?
The message names it: for column 'stock' at row 1. The row number is the position in that INSERT. Then check its type with SHOW CREATE TABLE t;.
Should I turn off strict mode to get rid of ERROR 1264?
Changing the column type is the fix that was run here. With strict mode on (the 8.4 default) MySQL refuses the row instead of saving a different number.
What is the maximum value of DECIMAL(5,2)?
999.99. The first number is the total number of digits, the second is digits after the point. 1250.00 needs DECIMAL(6,2) or more.
Why does my phone number not fit in INT?
INT stops at about 2.1 billion (10 digits). Store phone numbers in VARCHAR.
Does ERROR 1264 appear in Korean or Japanese?
No. With lc_messages set to Korean or Japanese, MySQL 8.4 still printed this message in English.
How we verify
Each scenario starts from fresh database users. A script runs the setup, confirms the exact error code, applies the fix and runs the statement again. The output shown is what the database printed, saved by the script.
lab_a and lab_b are ordinary users created for the test, each with full rights on a database of the same name (its default database); root is the administrator. MySQL 8.4.13