1262
MySQLWARNINGCriticalData ImportHIGH confidence

Row truncated: more input columns than table columns

Production Risk

Low — extra data is ignored; verify import completeness.

What this means

ER_WARN_TOO_MANY_RECORDS (1262, SQLSTATE 01000) is a warning issued during LOAD DATA INFILE when a row in the input file has more columns than specified in the column list or than the table has. Extra columns are ignored.

Why it happens
  1. 1Input file has more fields per row than the table column list specifies
  2. 2Column delimiter mismatch causing extra fields to be parsed
How to reproduce
trigger — this will error
trigger — this will error
LOAD DATA INFILE '/data/import.csv'
INTO TABLE products
FIELDS TERMINATED BY ','
(id, name);
-- If CSV row has 5 fields, extra 3 are ignored with warning 1262

expected output

Warning (Code 1262): Row 3 was truncated; it contained more data than there were input columns

Fix

Align the column list with the file structure

Align the column list with the file structure
LOAD DATA INFILE '/data/import.csv'
INTO TABLE products
FIELDS TERMINATED BY ','
(id, name, price, category, stock);  -- all columns present in file

Why this works

Explicitly listing all columns in the file ensures no data is silently discarded.

Sources
Official documentation ↗

MySQL 8.0 — 1262 ER_WARN_TOO_MANY_RECORDS

Content generated with AI assistance and reviewed for accuracy. Found an error? hello@errcodes.dev

← All MySQL errors