Can't load CSV into MySQL: Row 1 doesn't contain data for all columns Can't load CSV into MySQL: Row 1 doesn't contain data for all columns docker docker

Can't load CSV into MySQL: Row 1 doesn't contain data for all columns


Your table has 5 columns, the CSV only has 4 fields in each row.

The CSV is missing the timestamp column. If you want that to get the default value instead of taking it from the CSV, you need to list the columns explicitly in the LOAD DATA statement. The default is to fill in all the columns of the table.

LOAD DATA INFILE '/local/data/af_bases.csv' INTO TABLE bases (name, state, geohash, confirmed)FIELDS TERMINATED BY ','LINES TERMINATED BY '\n'; 


Error 1261 is a mismatch of columns and data i.e. having only 4 rows and 5 columns.