title: Load data infile (from csv): data too long for column 'xxx' at row N
body: <p>I am importing a .csv into Mysql like so:</p>
  
  <pre><code>LOAD DATA INFILE '(...)/contact_acquisition.csv'
  INTO TABLE rs_ui_db.contact_acquisition
  CHARACTER SET utf8
  FIELDS TERMINATED BY ','
  ENCLOSED BY '"'
  LINES TERMINATED BY '\n'
  IGNORE 1 ROWS;  
  </code></pre>
  
  <p>...which throws the following error:    </p>
  
  <blockquote>
    <p>"Data too long for column 'comments' at row 63"</p>
  </blockquote>
  
  <p>I look at row 63 of the .csv, and "comments" has a length of 115.</p>
  
  <p>The create statement seems OK (with <code>comments char(255)</code>) :</p>
  
  <pre><code>CREATE DATABASE IF NOT EXISTS `my_db` /*!40100 DEFAULT CHARACTER SET utf8 */;
  USE `my_db`;
  
  DROP TABLE IF EXISTS `contact_acquisition`;
  CREATE TABLE `contact_acquisition` (
    `SID` int(10) unsigned NOT NULL AUTO_INCREMENT,
    `pilot` char(255) NOT NULL,
    `contact` char(255) NOT NULL,
    `email` char(255) NOT NULL,
    `tel` char(255) NOT NULL,
    `comments` char(255) NOT NULL,
    PRIMARY KEY (`SID`)
  ) ENGINE=InnoDB AUTO_INCREMENT=76 DEFAULT CHARSET=utf8; 
  </code></pre>
  
  <p><strong>Before marking it as duplicate</strong>, please note:</p>
  
  <p><a href="https://stackoverflow.com/a/25500580/831138">This</a> StackOverflow solution obviously doesn't fit: I am already adding <code>CHARACTER SET utf8</code> to the <code>LOAD DATA</code> sql.</p>
  
  <p><a href="https://stackoverflow.com/a/18897579/831138">This</a> other StackOverflow solution seems a bit far-fetched to me, since all the data I am inserting (the create database statement, the create table statement, the CSV, etc...) has been extracted from another server in which the exact same row is allowed. I have used the Mysql Workbench in order to extract creates/csv etc.</p>
  
  <p>I am trying to export automatically from one server to another, so changing the data type in the destination is not an option for me.</p>
  
  <hr>
  
  <p><strong>Update</strong>:</p>
  
  <p>This is the line (obfuscated, but keeping the non-alphanumerical characters):</p>
  
  <p><code>64,xxxx xxxx,"xxxx xxxx, xxxx xxxx","xxxx.xxxx@xxxx.xxxx, xxxx.xxxx@xxxx-xxxx.xxxx.xxxx",xxxx (xxxx) xxxx xxxx xxxx xxxx xxxx (xxxx),"xxxx xxxx xxxx'xxxx xxxx xxxx xxxx xxxx xxxx xxxx, xxxx xxxx xxxx'xxxx xxxx xxxx'xxxx xxxx xxxx xxxx xxxx"</code></p>
  
  <p>The part MySQL complains about is: <code>"xxxx xxxx xxxx'xxxx xxxx xxxx xxxx xxxx xxxx xxxx, xxxx xxxx xxxx'xxxx xxxx xxxx'xxxx xxxx xxxx xxxx xxxx"</code>. Which is wrapped by <code>"</code>, contains 1 comma and 3 <code>'</code>. Other lines (from the same CSV) that are correctly imported also have these characters. The length seems to be the only difference with other lines.</p>
  
  <p>csv file is in utf8.</p>