title: LOAD DATA LOCAL INFILE Manipulate Some Date Columns
body: <p>I have a csv with 3 date columns but each is formatted dd/mm/yyyy H:i:s i.e 27/05/2019 20:25:00</p>
  
  <p>I am trying to manipulate these to insert using LOAD DATA INFILE without any success:</p>
  
  <p>My state looks like this:</p>
  
  <pre><code> LOAD DATA LOCAL INFILE '/file.csv' 
      INTO TABLE db_table FIELDS TERMINATED BY ',' 
      OPTIONALLY ENCLOSED BY '"' 
      LINES TERMINATED BY '\n' 
      IGNORE 1 LINES
      SET promotion_starts = str_to_date(@column7, '%d/%m/%Y %H:%i:%s'), 
      promotion_ends = str_to_date(@column8, '%d/%m/%Y %H:%i:%s'), 
      date_added = str_to_date(@column17, '%d/%m/%Y %H:%:%i:%s')
  </code></pre>
  
  <p>All other data inserts fine but the date columns are all null </p>