Q:

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

I spun a container with the mysql image. I am trying to load a CSV. 
It looks sort of like this but with more rows. It is located in /local/data/af_bases.csv within the container. You can get a copy of the file here.
Tinker AFB,Oklahoma,9y69rzbsh9mz,-1
Andrews AFB,Maryland,dqckf8m8ry2c,-1
Grissom AFB,Indiana,dp4xrf0ufvjd,-1

I create a database geolocations. And then I want to run the following:
USE geolocations;

CREATE TABLE bases( 
name varchar(255), 
state varchar(255), 
geohash varchar(255),
confirmed float,
timestamp timestamp not null default current_timestamp on update current_timestamp
);

LOAD DATA INFILE '/local/data/af_bases.csv' INTO TABLE bases 
FIELDS TERMINATED BY ',' ENCLOSED BY '' 
LINES TERMINATED BY '\n'; 

However, I get the following:
ERROR 1261 (01000): Row 1 doesn't contain data for all columns

I have tried enclosing the data in double quotations and doing ENCLOSED BY '"' but it doesn't seem to like it either way.
Any ideas? Thanks :) 

A:

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'; 

