Loading data from a local infile
Posted 31 October 2003 - 06:56 PM
Could somebody please tell me where the data file \"pet.txt\" has to be for the above instruction to work?
Posted 31 October 2003 - 07:40 PM
with that I believe you have to have the pet.txt in the same directory the mysql program is running in. a better way to do it would be like
mysql> LOAD DATA LOCAL INFILE \"/path/to/file/pet.txt\" INTO pet;
and make sure the permissions are set so mysql can access it.
if your running on windows then I think the path needs to be something like
mysql> LOAD DATA LOCAL INFILE \"C:\\path\\to\\file\\pet.txt\" INTO pet;
hope that helps
Posted 01 November 2003 - 05:23 AM
How are the fields seprated and how are the records seprated.
If you have it as CSV comma seprated vlaues you can try this
LOAD DATA INFILE \'C:\\pet.txt\' INTO TABLE pet FIELDS TERMINATED BY \',\' LINES TERMINATED BY \'n\';
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users