I'm new to MySQL and am having trouble configuring the LOAD DATA INFILE syntax. I want to import .csv's every week into a table with 4 columns: sessionid, libraryid, authclients, and dates. I'm using MySQL Query Browser and will be working on the machine that runs the server. The query I used:
load data infile 'C:/Users/ME/Desktop/testimport.csv'
into table wirelessap ignore 1 lines
fields terminated by ','
lines terminated by '/n'
(libraryid, sessionid, dates, authclients);
Error message(1064): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'fields terminated by ','
lines terminated by '/n'
(libraryid, sessionid, dates' at line 3
Other things I'm wondering about:
The "dates" column is set for DATETIME, however the .csv is not in proper format. For example, one row in the .csv says 11/9/2009 6:15. In correct DATETIME formatting it needs to be 2009-11-09 06:15:00. Does the import fix this automatically or do I need to add something?
When I get sent the .csv's, one column is called "Library name". Rather than manually changing the names to the correct "Library ID", can I change the LOAD DATA INFILE statement to do this? For example, whenever it reads 'BigLibrary' it changes the value to '1'
Is there a free GUI for MySQL that can customize the way I want .csv's to be imported? I've found the EMS Data Import for MySQL and it works great, but unfortunately its a trial version.
Thanks for your help