MySQL 8.4Lab-verified · 2026-12-01

MySQL ERROR 1366 (HY000): Incorrect integer, decimal or string value for column

The value cannot be converted to the column type (or character set), and MySQL 8.4 in strict mode rejects it.

MySQL 8.4.13
1366 (HY000): Incorrect integer value: '' for column 'stock' at row 1

Jump to a cause

  1. 01Empty string '' inserted into an INT column
  2. 02Number with thousands separators such as '1,200.50' into DECIMAL
  3. 03INSERT … SELECT from a text staging table with non-numeric values
  4. 04Emoji (4-byte character) into a utf8mb3 column
  5. 05Empty values written as the text 'NULL' in a CSV

Lab-verifiedReproduced and fixed on MySQL 8.4.13 · 2026-12-01 · container image mysql:8.4

The message shows the rejected value, the column and the row number: Incorrect integer value: 'N/A' for column 'qty' at row 2. The word before value tells you what MySQL tried to convert to — integer, decimal, or string (character set).

MySQL 8.4 has STRICT_TRANS_TABLES in the default sql_mode, and these conversions stop the statement with an error. The message is in English even with Korean or Japanese lc_messages.

01Empty string '' inserted into an INT column

Web forms often send an empty field as ''. An empty string is not a number, so stock rejects it. The session sql_mode includes STRICT_TRANS_TABLES, so the statement fails.

Setup
Setuprun as lab_a
CREATE TABLE products (id INT PRIMARY KEY, name VARCHAR(50), stock INT);
OUTPUT
Query OK, 0 rows affected (0.01 sec)
Reproducerun as lab_a
INSERT INTO products (id, name, stock) VALUES (1, 'Pen', '');
✕ ERROR
ERROR 1366 (HY000): Incorrect integer value: '' for column 'stock' at row 1
Checkrun as lab_a
SELECT @@SESSION.sql_mode;
OUTPUT
+-----------------------------------------------------------------------------------------------------------------------+
| @@SESSION.sql_mode                                                                                                    |
+-----------------------------------------------------------------------------------------------------------------------+
| ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION |
+-----------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)

Send NULL when the field is empty (convert it in the application). The row is stored with stock NULL.

After the fixrun as lab_a
INSERT INTO products (id, name, stock) VALUES (1, 'Pen', NULL);
SELECT id, name, stock FROM products;
✓ SUCCESS
Query OK, 1 row affected (0.01 sec)

+----+------+-------+
| id | name | stock |
+----+------+-------+
|  1 | Pen  |  NULL |
+----+------+-------+
1 row in set (0.00 sec)

02Number with thousands separators such as '1,200.50' into DECIMAL

Values copied from Excel or a screen often keep the comma. DECIMAL does not accept 1,200.50, so the message says Incorrect decimal value.

Setup
Setuprun as lab_a
CREATE TABLE payments (id INT PRIMARY KEY, amount DECIMAL(10,2));
OUTPUT
Query OK, 0 rows affected (0.01 sec)
Reproducerun as lab_a
INSERT INTO payments (id, amount) VALUES (1, '1,200.50');
✕ ERROR
ERROR 1366 (HY000): Incorrect decimal value: '1,200.50' for column 'amount' at row 1
Checkrun as lab_a
SELECT REPLACE('1,200.50', ',', '') AS cleaned;
OUTPUT
+---------+
| cleaned |
+---------+
| 1200.50 |
+---------+
1 row in set (0.00 sec)

Remove the separator before inserting. REPLACE('1,200.50', ',', '') gives 1200.50, which is stored as is.

After the fixrun as lab_a
INSERT INTO payments (id, amount) VALUES (1, REPLACE('1,200.50', ',', ''));
SELECT id, amount FROM payments;
✓ SUCCESS
Query OK, 1 row affected (0.00 sec)

+----+---------+
| id | amount  |
+----+---------+
|  1 | 1200.50 |
+----+---------+
1 row in set (0.00 sec)

03INSERT … SELECT from a text staging table with non-numeric values

Data loaded from CSV into VARCHAR columns may contain values like N/A. Copying it into an INT column stops at the first bad row (at row 2), and no rows are inserted.

Setup
Setuprun as lab_a
CREATE TABLE staging_orders (order_no VARCHAR(20), qty VARCHAR(20));
INSERT INTO staging_orders VALUES ('A-1', '3'), ('A-2', 'N/A'), ('A-3', '5');
CREATE TABLE orders (order_no VARCHAR(20) PRIMARY KEY, qty INT);
OUTPUT
Query OK, 0 rows affected (0.01 sec)

Query OK, 3 rows affected (0.00 sec)
Records: 3  Duplicates: 0  Warnings: 0

Query OK, 0 rows affected (0.02 sec)
Reproducerun as lab_a
INSERT INTO orders (order_no, qty) SELECT order_no, qty FROM staging_orders;
✕ ERROR
ERROR 1366 (HY000): Incorrect integer value: 'N/A' for column 'qty' at row 2
Checkrun as lab_a
SELECT order_no, qty FROM staging_orders WHERE qty NOT REGEXP '^[0-9]+$';
OUTPUT
+----------+------+
| order_no | qty  |
+----------+------+
| A-2      | N/A  |
+----------+------+
1 row in set (0.00 sec)

Find the bad values with NOT REGEXP '^[0-9]+$', then convert only valid numbers and turn the rest into NULL with CASE WHEN … REGEXP … THEN qty END. All 3 rows are copied and A-2 gets NULL. Decide whether NULL is right for your data.

After the fixrun as lab_a
INSERT INTO orders (order_no, qty)
SELECT order_no, CASE WHEN qty REGEXP '^[0-9]+$' THEN qty END FROM staging_orders;
SELECT order_no, qty FROM orders ORDER BY order_no;
✓ SUCCESS
Query OK, 3 rows affected (0.00 sec)
Records: 3  Duplicates: 0  Warnings: 0

+----------+------+
| order_no | qty  |
+----------+------+
| A-1      |    3 |
| A-2      | NULL |
| A-3      |    5 |
+----------+------+
3 rows in set (0.00 sec)

04Emoji (4-byte character) into a utf8mb3 column

Incorrect string value: '\xF0\x9F\x91\x8D' shows the bytes of 👍. Emoji need 4 bytes in UTF-8, but utf8mb3 stores at most 3 bytes per character. The column body is utf8mb3.

Setup
Setuprun as lab_a
CREATE TABLE reviews (id INT PRIMARY KEY, body VARCHAR(100)) CHARACTER SET utf8mb3;
OUTPUT
Query OK, 0 rows affected, 1 warning (0.01 sec)
Reproducerun as lab_a
SET NAMES utf8mb4;
INSERT INTO reviews VALUES (1, 'Great 👍');
✕ ERROR
Query OK, 0 rows affected (0.00 sec)

ERROR 1366 (HY000): Incorrect string value: '\xF0\x9F\x91\x8D' for column 'body' at row 1
Checkrun as lab_a
SELECT column_name, character_set_name FROM information_schema.columns WHERE table_schema = 'lab_a' AND table_name = 'reviews';
OUTPUT
+-------------+--------------------+
| COLUMN_NAME | CHARACTER_SET_NAME |
+-------------+--------------------+
| body        | utf8mb3            |
| id          | NULL               |
+-------------+--------------------+
2 rows in set (0.00 sec)
Fixrun as lab_a
ALTER TABLE reviews CONVERT TO CHARACTER SET utf8mb4;
OUTPUT
Query OK, 0 rows affected (0.00 sec)
Records: 0  Duplicates: 0  Warnings: 0

Convert the table with ALTER TABLE reviews CONVERT TO CHARACTER SET utf8mb4. The same INSERT then stores Great 👍. The client connection must also be utf8mb4 (SET NAMES utf8mb4).

After the fixrun as lab_a
SET NAMES utf8mb4;
INSERT INTO reviews VALUES (1, 'Great 👍');
SELECT id, body FROM reviews;
✓ SUCCESS
Query OK, 0 rows affected (0.00 sec)

Query OK, 1 row affected (0.01 sec)

+----+------------+
| id | body       |
+----+------------+
|  1 | Great 👍     |
+----+------------+
1 row in set (0.00 sec)

05Empty values written as the text 'NULL' in a CSV

The export tool wrote empty values as the word NULL. In a text column it looks like a real NULL, but it is the 4-character string 'NULL', so the INT column rejects it (at row 2).

Setup
Setuprun as lab_a
CREATE TABLE stock (item VARCHAR(10) PRIMARY KEY, qty INT);
CREATE TABLE stock_upload (item VARCHAR(10), qty VARCHAR(20));
INSERT INTO stock_upload VALUES ('A100', '12'), ('B200', 'NULL'), ('C300', '7');
OUTPUT
Query OK, 0 rows affected (0.01 sec)

Query OK, 0 rows affected (0.02 sec)

Query OK, 3 rows affected (0.00 sec)
Records: 3  Duplicates: 0  Warnings: 0
Reproducerun as lab_a
INSERT INTO stock SELECT item, qty FROM stock_upload;
✕ ERROR
ERROR 1366 (HY000): Incorrect integer value: 'NULL' for column 'qty' at row 2
Checkrun as lab_a
SELECT item, qty, qty IS NULL AS is_real_null FROM stock_upload WHERE qty NOT REGEXP '^[0-9]+$';
OUTPUT
+------+------+--------------+
| item | qty  | is_real_null |
+------+------+--------------+
| B200 | NULL |            0 |
+------+------+--------------+
1 row in set (0.00 sec)

The check shows qty as NULL, yet qty IS NULL is 0 (false). Inserting NULLIF(qty, 'NULL') loaded all 3 rows, and only B200 became a real NULL.

After the fixrun as lab_a
INSERT INTO stock SELECT item, NULLIF(qty, 'NULL') FROM stock_upload;
SELECT * FROM stock ORDER BY item;
✓ SUCCESS
Query OK, 3 rows affected (0.01 sec)
Records: 3  Duplicates: 0  Warnings: 0

+------+------+
| item | qty  |
+------+------+
| A100 |   12 |
| B200 | NULL |
| C300 |    7 |
+------+------+
3 rows in set (0.00 sec)

FAQ

How do I fix MySQL 1366 Incorrect integer value: '' for column?

Send NULL (or a number) instead of an empty string. The default sql_mode in MySQL 8.4 includes STRICT_TRANS_TABLES, so the empty string is rejected.

What does Incorrect string value '\xF0\x9F...' mean?

You are storing a 4-byte character such as an emoji into a utf8mb3 column. Convert the table to utf8mb4 and use a utf8mb4 connection.

Why does Incorrect decimal value appear for '1,200.50'?

DECIMAL does not accept thousands separators. Remove commas with REPLACE before inserting.

Why do I get Incorrect integer value: 'NULL'?

The value is not a real NULL but the text 'NULL', often from a CSV. Convert it with NULLIF(col, 'NULL') before inserting.

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