Is there a way to truncate the microseconds of a CSV value when importing data using LOAD DATA INFILE? I'm loading data using LOAD DATA INFILE in 5.5 where the value includes microseconds. I must use DATETIME data type. Currently, I'm using regular expressions to remove them from the CSV prior to import. I'm wondering if there's an option in MySQL to truncate them so it only loads YYYY-MM-DD HH:MM:SS?

Thanks
You can use variables to edit your input data for example.


  LOAD DATA LOCAL INFILE 'file name ' INTO TABLE table (@var1) SET
  Date=str_to_date(@var1,'%Y-%m-%d')


You can use this method for a lot of different stuff like loading only the 3 first char of a string or doing some mathematical funcion etc.

Example 


  LOAD DATA LOCAL INFILE 'file name' INTO TABLE table (@var1) SET
  Date=substring(@var1,1,3).


Hope this helps