title: Mysql CSV Importing - Problems with Last Field
body: <p>This is what the csv data looks like:</p>
  
  <pre><code>"COUNTRY_ALPHA2_CODE","COUNTRY_NUMERIC_CODE","COUNTRY_NAME","REGION_CODE","REGION_NAME"
  "AD","020","Andorra","02","Canillo"
  "AD","020","Andorra","03","Encamp"
  "AD","020","Andorra","04","La Massana"
  "AD","020","Andorra","05","Ordino"
  </code></pre>
  
  <p>When I try importing it using the following code:</p>
  
  <pre><code>LOAD DATA LOCAL INFILE 'COUNTRIES.CSV'
  INTO TABLE countries
  FIELDS TERMINATED BY ','
  OPTIONALLY ENCLOSED BY '"'
  ESCAPED BY '"'
  LINES TERMINATED BY '\n'
  IGNORE 1 LINES;
  select * from countries; 
  </code></pre>
  
  <p>I get very weird behavior on the last field, as if it was looking for the last field to have a comma.</p>
  
  <pre><code>+-------------------------+---------------------+---------------------+----------------------+
  | COUNTRY_NAME            | COUNTRY_ALPHA2_CODE | COUNTRY_ALPHA3_CODE | COUNTRY_NUMERIC_CODE |
  +-------------------------+---------------------+---------------------+----------------------+
  | Afghanistan             | AF                  | AFG                 | 004"
  "Ant           |
  | Anguilla                | AI                  | AIA                 | 660"
  "Alb           |
  | Aland Islands           | AX                  | ALA                 | 248"
  "Aze           |
  | Andorra    
  </code></pre>
  
  <p>I looked at examples of CSV importing and the data seemed to be in the same format without a comma at the end. Not sure how to tell mysql that the last field will not have comma.</p>