- Error number
- 1136
- SQLSTATE
21S01- Symbol
ER_WRONG_VALUE_COUNT_ON_ROW- Product
- MySQL Server
- Versions
- All MySQL versions (checked on MySQL 8.0.46)
- Category
- Syntax & Names
- Last reviewed
- 24 October 2026
On this page
What it means
Error 1136 means an INSERT or REPLACE supplies a different number of values than the number of columns it is filling.
For each row, MySQL pairs the values with the target columns by position: the first value goes into the first column, and so on. The target columns are the list in brackets after the table name or, when there is no list, every column of the table in table order. If a row has more or fewer values than that, MySQL cannot pair them and rejects the whole statement with 1136; no rows are inserted.
at row n counts value lists from 1, so at row 2 in a multi-row INSERT points at the second bracketed list. For INSERT ... SELECT the count compares the SELECT list with the target columns. The most common surprise is an INSERT without a column list that worked for months and then fails, because a migration added a column to the table.
Common causes
- An INSERT without a column list after a column was added to (or dropped from) the table.
- A missing or extra value in one row of a multi-row INSERT, often in data generated by a script or pasted from a spreadsheet.
- Two values merged into one string by a misplaced quote:
'Ali, York'is one value, not two. INSERT INTO target SELECT * FROM sourcewhere the two tables do not have the same number of columns.- A column list and a SELECT list that were edited separately, so one has more entries than the other.
Diagnose it
Read-only These statements only read metadata (information_schema, performance_schema and SHOW statements) or your own data. They do not change data, privileges or configuration, so they are safe to run first.
How many columns does the table have, and in what order?
SELECT ordinal_position, column_name, is_nullable, column_default, extra
FROM information_schema.columns
WHERE table_schema = DATABASE()
AND table_name = 'customers'
ORDER BY ordinal_position; Every column in table order. An INSERT without a column list must supply exactly this many values in this order. Columns with a default, NULL allowed or AUTO_INCREMENT can be left out when you name the columns explicitly.
Compare the column counts of source and target before INSERT ... SELECT
SELECT table_name, COUNT(*) AS column_count
FROM information_schema.columns
WHERE table_schema = DATABASE()
AND table_name IN ('customers', 'staging_customers')
GROUP BY table_name; Different counts mean SELECT * cannot be used; list the columns on both sides instead.
How to fix it
Each fix is labelled with what it changes. Try read-only checks and the least invasive fix first, and test changes outside production.
Always name the target columns
Changes dataWith an explicit column list, the INSERT only depends on the columns it names, so adding a column with a default (or one that allows NULL) to the table later does not break it. This is the main fix and the best habit.
INSERT INTO customers (id, name, city)
VALUES (2, 'Ali', 'York');
Give every row the same number of values
Changes dataFind the row named in the message and complete it. Use NULL or DEFAULT for a value you do not have, rather than leaving it out.
INSERT INTO customers (id, name, city)
VALUES (2, 'Ali', 'York'),
(3, 'Zoe', DEFAULT),
(4, 'Sam', 'Hull');
List the columns on both sides of INSERT ... SELECT
Changes dataMap source columns to target columns explicitly. This also protects you from columns that have the same count but a different order, which would not raise 1136 but would put data in the wrong columns.
INSERT INTO customers (id, name, city, email)
SELECT id, name, city, email
FROM staging_customers;
Examples
An INSERT without a column list after a new column was added
CREATE TABLE customers (id INT PRIMARY KEY, name VARCHAR(100), city VARCHAR(50));
INSERT INTO customers VALUES (1, 'Sara', 'Leeds'); -- works
ALTER TABLE customers ADD COLUMN email VARCHAR(200);
INSERT INTO customers VALUES (2, 'Ali', 'York'); -- now 4 columns, 3 values
ERROR 1136 (21S01): Column count doesn't match value count at row 1
Reproduced on MySQL 8.0.46, 24 October 2026.
One short row in a multi-row INSERT
CREATE TABLE customers (id INT PRIMARY KEY, name VARCHAR(100), city VARCHAR(50));
INSERT INTO customers (id, name, city)
VALUES (2, 'Ali', 'York'),
(3, 'Zoe'),
(4, 'Sam', 'Hull');
ERROR 1136 (21S01): Column count doesn't match value count at row 2
Reproduced on MySQL 8.0.46, 24 October 2026.
A misplaced quote turns two values into one
CREATE TABLE customers (id INT PRIMARY KEY, name VARCHAR(100), city VARCHAR(50));
INSERT INTO customers (id, name, city) VALUES (2, 'Ali, York');
ERROR 1136 (21S01): Column count doesn't match value count at row 1
Reproduced on MySQL 8.0.46, 24 October 2026.
INSERT ... SELECT * between tables of different width
CREATE TABLE customers (id INT PRIMARY KEY, name VARCHAR(100), city VARCHAR(50), email VARCHAR(200));
CREATE TABLE staging_customers (id INT, name VARCHAR(100), city VARCHAR(50), email VARCHAR(200), source VARCHAR(20));
INSERT INTO staging_customers VALUES (5, 'Kim', 'Bath', 'kim@example.com', 'csv');
INSERT INTO customers SELECT * FROM staging_customers;
ERROR 1136 (21S01): Column count doesn't match value count at row 1
Reproduced on MySQL 8.0.46, 24 October 2026.
How to prevent it
Name the columns in every INSERT, REPLACE and INSERT ... SELECT in application code and scripts, and avoid SELECT * as the source of an insert. Then adding a column that has a default or allows NULL never breaks existing writes.
When you generate multi-row INSERTs from files or spreadsheets, validate that every record has the expected number of fields before building the SQL, and pass values as parameters so a comma or quote inside a value cannot change the count.
Common questions
How do I fix "Column count doesn't match value count at row 1"?
Count the columns you are inserting into and the values in the row. Without a column list, MySQL expects one value for every column of the table, in table order. Add a column list naming exactly the columns you supply, or add the missing values.
What does "at row 2" mean?
It is the position of the value list in a multi-row INSERT, counting from 1. The second bracketed list has the wrong number of values. The whole statement is rejected, so the other rows are not inserted either.
My INSERT worked before. Why does it fail now?
The table most likely gained or lost a column. An INSERT without a column list depends on the exact number and order of columns, so any schema change breaks it. Name the columns and it will keep working.
Does an AUTO_INCREMENT id need a value?
Only when you leave out the column list, because then every column needs a value (you can pass NULL or DEFAULT for the id). With a column list, simply leave the id column out and MySQL generates it.
Learn more on CodeWithSQL
Official documentation
Last technically reviewed 24 October 2026; examples and diagnostics run on MySQL 8.0.46. Message templates checked against the server's error catalogue (perror) for that version.