trying to read in data from file
"adrian GREEMAN" <[email protected]> Thu, 7 Sep 2006 18:25:40 +0100
| Newsgroups | gmane.comp.db.mysql.windows |
|---|---|
| Organization | Pix and Words |
| Message-ID | <000301c6d2a2$a4c69350$3bce4554@ADRIAN1> |
I have My SQL 5.0.21 and either the GUI MySQL Query tool or phpMySQLAdmin to run queries via Apache 1.3 on a Win XP SP2 computer. I am trying to load some data from a text file with comma separators and Windows line ends - it is exported from an Approach database which escapes double quotes with double quotes. As far as I know this works just like a slash \. I ran this query SQL query: LOAD DATA LOCAL INFILE 'C:\\etc.\\My Documents\\the_file.txt' INTO TABLE chng (IssueNo, Head, Chardate, auth_id, PaperName) FIELDS TERMINATED BY ',' FIELDS OPTIONALLY ENCLOSED BY '\"' LINES TERMINATED BY '\r\n'; and got the errors Documentation #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 ',' FIELDS OPTIONALLY ENCLOSED BY '\"' LINES TERMINATED BY' at line 3 I have looked at the manual but cannot see what I am doing wrong. Please would the experts out there spot my beginners mistakes? Regards Adrian