mysqldude
Error codes › 1136

MySQL & MariaDB error 1136: Column count doesn't match value count at row 1

Error messageColumn count doesn't match value count at row …
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.

MySQLMariaDB
SymbolER_WRONG_VALUE_COUNT_ON_ROWER_WRONG_VALUE_COUNT_ON_ROW
SQLSTATE21S0121S01
TypeServer errorServer error
Versionsevery release since 5.0 activeevery 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 … SELECT where 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.

  1. Connect with mysql -u root -p and create a scratch database and the test data:

    CREATE DATABASE demo;
    USE demo;
    CREATE TABLE p (id INT, name VARCHAR(20), email VARCHAR(50));
  2. Run:

    INSERT INTO p VALUES (1, 'Ann');

You get: Column count doesn't match value count at row 1(11.8.9)

Verified fixes

  1. Always name the columns you insert

    INSERT INTO p (id, name) VALUES (1, 'Ann');
    SELECT COUNT(*) FROM p;

Tested on

StepMySQLMariaDB
5.65.78.08.4910.610.1111.411.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

Related errors

  • 1054 ER_BAD_FIELD_ERRORexplained
  • 1364 ER_NO_DEFAULT_FOR_FIELDexplained