Users Pricing

forum

Home Forums MySQL reading date from CSV – MindStick

MySQL reading date from CSV

Madam Walker 2955 09 Jul 2013
Hi Expert,

Right now I have a database in the format with columns:

id - purchase_date - integer fields.....
And an import of a CSV using the script

LOAD DATA LOCAL INFILE 'C:/Users/Alex/Desktop/work/natgas2.csv' INTO TABLE pricemodel.natural_gas 
   FIELDS
        TERMINATED BY ',' 
        ENCLOSED BY '"'
        LINES TERMINATED BY '\r\n';
And everything's being imported correctly except for the dates which are in the format right now of:

1/3/2011
So the question is what format do they have to be in for them to be read correctly into my database?

Please help?

Thanks in advance. 


1 Answers

Markdown for AI

A clean, structured version of this page for AI assistants and LLMs.

Open .md