MySQL Forums
Forum List  »  Newbie

Re: How to load text or sql file into mysql commandLine?
Posted by: John seito
Date: October 27, 2007 12:17PM

I created a text file called "addresses.txt" and I tried saving it to the mysql folders where I have installed mySQL and I run this code

Code ------ LOAD DATA LOCAL INFILE "addresses.txt" INTO TABLE phoneList;

in command line and hoping that it this txt file's data would insert into my phoneList table, but I received an error from command line saying can't find addresses.txt file.

After you said I can store the file anywhere on my system but I need to show the path and I did just that. I use that same text file save it in the htdocs folder in C: drive and went to command Line and enter this code

Code ---- LOAD DATA LOCAL INFILE "c:\Apache\htdocs\addresses.txt" INTO TABLE phoneList;

this code doesn't work either.

Maybe there is a syntax error with the code and path?

Thanks,

Options: ReplyQuote




Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.