title: Trim data which is longer than the column length in MySQL
body: <p>I'm inserting data into a table in MySQL using the following query,</p>
  
  <pre><code>LOAD DATA INFILE 'file.csv' INTO TABLE CSVImport FIELDS TERMINATED BY ',' LINES  TERMINATED BY '\n';
  </code></pre>
  
  <p>But when the length of a particular field is greater than the column length it fails as expected. Is there any way to trim the length and set to the length of the column. I know that I can change the sql_mode. But when I do that it will effect to other validations as well. And also it will applied to the whole mysql server as well. </p>
  
  <p>1) Is there any way to apply the sql_mode only to a particular table?</p>
  
  <p>2) Is there any way to achieve this without changing the sql_mode?</p>