DateTime Format in .csv file:
4/18/2017 22:15
The file is being read like this:
load data local infile 'C:/somedirectory/somefile.csv'
into table InFile
fields terminated by ',' lines terminated by '\n' ignore 1 lines;
Loading this into a predefined table with the date-time column type datetime fails.
Loading this into a predefined table with the date-time column type varchar(25) works.
How do I change the order of the day/month/year in the table (not just dynamically) so I can do this:
ALTER TABLE InFile MODIFY COLUMN date-time datetime;
(After this question was answered it got marked as a possible duplicate. While the other answer is close, this question is about date AND time, and the answer here shows how to include the time part. It may not be obvious to new MySQL users that you can add the ' ' and ':' in the middle of the % letters.)