I am trying to import csv file to MySQL database everything works fine except datetime does not load.
My csv file datetime format is '19/05/2014 14:44:44'
and MySQL date format is '2014-02-18 09:44:30'
while trying to import it comes up as '0000-00-00 00:00:00'
I tried different ways but i don't understand where am I going wrong.
LOAD DATA LOCAL INFILE 'I:/finaltest12.csv' INTO TABLE tickets FIELDS terminated by ',' ENCLOSED BY '\"' lines terminated by '\n' IGNORE 1 LINES (SiteId,@var1,Serial,DeviceId,AgentAID,VehicleRegistration,CarPark,SpaceNumber,GpsAddress,VehicleType,VehicleMake,VehicleModel,VehicleColour,IssueReasonCode,IssueReason,NoticeLocation,Points,Notes) SET DateTime = STR_To_DATE(@var1,'%yyyy-%MM-%dd %H:%i:%s')";
MySqlCommand cmd1 = new MySqlCommand(strLoadData, conn);
when i run this i get the above error fatal error encountered.