Common SQL Errors

MySQL Error 1136: ER_WRONG_VALUE_COUNT_ON_ROW - Fix Column Count Mismatches

Galaxy Team
August 5, 2025

The INSERT or REPLACE statement supplies a different number of values than the target table or column list expects.

Sign up for the latest in common SQL errors from the Galaxy Team!
Welcome to the Galaxy, Guardian!
You'll be receiving a confirmation email

Follow us on twitter :)
Oops! Something went wrong while submitting the form.

What is MySQL error 1136?

MySQL Error 1136: ER_WRONG_VALUE_COUNT_ON_ROW arises when the number of values in an INSERT, REPLACE, or VALUES clause does not equal the number of target columns. Align the column list and value list or supply default values to fix the problem.

Error Highlights

Typical Error Message

Column count doesn't match value count at row %ld

Error Type

Data Definition Error

Language

MySQL

Symbol

ER_WRONG_VALUE_COUNT_ON_ROW

Error Code

1136

SQL State

Explanation

Table of Contents

What is MySQL Error 1136: ER_WRONG_VALUE_COUNT_ON_ROW?

Error 1136 appears when MySQL processes an INSERT, REPLACE, or LOAD DATA statement and finds that the number of supplied values differs from the table’s column count or the explicit column list.

The server stops execution and returns SQLSTATE 21S01 along with the message "Column count doesn't match value count at row N" where N is the failing row index.

What Causes This Error?

A missing or extra value in the VALUES list is the most common trigger.

When no explicit column list is provided, MySQL assumes every column must receive a value or its default.

Using INSERT ... SELECT with mismatched selected columns, bulk imports through LOAD DATA, and wrong SET clauses in UPDATE ... SET row constructors can also raise 1136.

How to Fix MySQL Error 1136

Count the target columns first, then count the values supplied. They must match exactly.

Provide an explicit column list to insert a subset of columns, or add DEFAULT for columns that should receive default values.

Validate CSV or TSV files before LOAD DATA, ensuring each row has the same delimiter count.

Within Galaxy, the live preview highlights column counts, preventing commits with mismatched rows.

Common Scenarios and Solutions

INSERT with AUTO_INCREMENT - omit the id column but include it in the column list: INSERT INTO users(name,email) VALUES('Ann','a@b.com');

Bulk import file missing trailing delimiter - fix the source file or use LINES TERMINATED BY '\n' IGNORE 1 LINES for headers.

Best Practices to Avoid This Error

Always specify an explicit column list in INSERT and REPLACE commands.

Version control schema changes so teams know the current column order.

Add automated checks in Galaxy or CI pipelines that run SELECT COUNT(*) FROM table_name LIMIT 0 to fetch expected column counts before data loads.

Related Errors and Solutions

Error 1054 unknown column occurs when column names are misspelled rather than mismatched in count.

Error 1364 field doesn't have a default arises when a NOT NULL column without default is omitted.

These errors often appear together during migrations; fixing the column list or defaults resolves them simultaneously.

.

Common Causes

Related Errors

FAQs

Should I always list columns in INSERT statements?

Yes. Listing columns explicitly prevents errors when the schema changes and documents intent.

Can I insert only some columns and let others default?

Absolutely. Provide an explicit column list and omit columns that have defaults or allow NULL.

Does AUTO_INCREMENT affect error 1136?

Yes. If you skip the AUTO_INCREMENT column without a column list, MySQL still counts it, causing a mismatch.

How does Galaxy help avoid this error?

Galaxy’s real-time linting counts VALUES against target columns, flagging mismatches before queries reach MySQL.

Start Querying with the Modern SQL Editor Today!
Welcome to the Galaxy, Guardian!
You'll be receiving a confirmation email

Follow us on twitter :)
Oops! Something went wrong while submitting the form.

Check out some other errors

Trusted by top engineers on high-velocity teams
Aryeo Logo
Assort Health
Curri
Rubie Logo
Bauhealth Logo
Truvideo Logo