jas:load_data_infile
Load Data Infile
The “\” path name separator character
Path name components in Windows are separated by the “\” character, which is also the escape character in MySQL. If you are using LOAD DATA INFILE or SELECT … INTO OUTFILE, use Unix-style file names with “/” characters:
mysql> LOAD DATA INFILE 'C:/tmp/skr.txt' INTO TABLE skr; mysql> SELECT * INTO OUTFILE 'C:/tmp/skr.txt' FROM skr;
+++++++++++++++++++++++++
mysql> LOAD DATA LOCAL INFILE '/path/pet.txt' INTO TABLE pet;
Note that if you created the file on Windows with an editor that uses \r\n as a line terminator, you should use:
mysql> LOAD DATA LOCAL INFILE '/path/pet.txt' INTO TABLE pet
- > LINES TERMINATED BY '\r\n';
+++++++++++++++++++++++++++++++++
jas/load_data_infile.txt · Last modified: 2009/05/02 11:27 by 127.0.0.1