Error codes › 1136
MySQL & MariaDB error 1136: Column count doesn't match value count at row 1
Example from our test runs:
Column count doesn't match value count at row 1 (5.6.51) The INSERT supplies a different number of values than there are columns, either in the table (no column list) or in the column list you gave.
| MySQL | MariaDB | |
|---|---|---|
| Symbol | ER_WRONG_VALUE_COUNT_ON_ROW | ER_WRONG_VALUE_COUNT_ON_ROW |
| SQLSTATE | 21S01 | 21S01 |
| Type | Server error | Server error |
| Versions | every release since 5.0 active | every release since 5.5 active |
What it means
INSERT INTO p VALUES (1, 'Ann') into a three-column table: without a column list, MySQL expects a value for every column, in table order. “Row 1” tells you which row of a multi-row INSERT is wrong.
Why it happens
- The table gained a column (a migration ran) and an INSERT without a column list now has one value too few.
- A missing or extra comma inside the VALUES list.
- In a multi-row INSERT, one row has a different number of values from the others.
INSERT … SELECTwhere the SELECT returns a different number of columns.
How to fix it
- Always name the columns:
INSERT INTO p (id, name) VALUES (1, 'Ann');. It also protects the statement from future schema changes. - Count the values in the reported row.
Reproduce it yourself
These steps are the exact test our harness runs. Use a scratch server, never production.
Connect with
mysql -u root -pand create a scratch database and the test data:CREATE DATABASE demo; USE demo; CREATE TABLE p (id INT, name VARCHAR(20), email VARCHAR(50));Run:
INSERT INTO p VALUES (1, 'Ann');
You get: Column count doesn't match value count at row 1(11.8.9)
Verified fixes
Always name the columns you insert
INSERT INTO p (id, name) VALUES (1, 'Ann'); SELECT COUNT(*) FROM p;
Tested on
| Step | MySQL | MariaDB | |||||||
|---|---|---|---|---|---|---|---|---|---|
| 5.6 | 5.7 | 8.0 | 8.4 | 9 | 10.6 | 10.11 | 11.4 | 11.8 | |
| INSERT without a column list and too few values repro | ✓ 1136 | ✓ 1136 | ✓ 1136 | ✓ 1136 | ✓ 1136 | ✓ 1136 | ✓ 1136 | ✓ 1136 | ✓ 1136 |
| Always name the columns you insert fix | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
INSERT without a column list and too few values repro
MySQL 5.6✓ 11365.7✓ 11368.0✓ 11368.4✓ 11369✓ 1136
MariaDB 10.6✓ 113610.11✓ 113611.4✓ 113611.8✓ 1136
Always name the columns you insert fix
MySQL 5.6✓5.7✓8.0✓8.4✓9✓
MariaDB 10.6✓10.11✓11.4✓11.8✓
✓works ✓ 1062fails with the error the step demonstrates ⚠works with a warning ≠runs, result differs ✗fails Tested 2026-11-25 on 5.6.51, 5.7.44, 8.0.46, 8.4.13, 9.7.4, 10.6.28, 10.11.19, 11.4.13, 11.8.9