fredpickwick Posted October 31, 2003 Share Posted October 31, 2003 mysql> LOAD DATA LOCAL INFILE \"pet.txt\" INTO pet; Could somebody please tell me where the data file \"pet.txt\" has to be for the above instruction to work? Quote Link to comment Share on other sites More sharing options...
DylanBlitz Posted October 31, 2003 Share Posted October 31, 2003 mysql> LOAD DATA LOCAL INFILE \"pet.txt\" INTO pet; 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 Quote Link to comment Share on other sites More sharing options...
shivabharat Posted November 1, 2003 Share Posted November 1, 2003 How have you stored the value sin the text files meaning 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\'; Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.