Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

LOAD DATA LOCAL INFILE

Status
Not open for further replies.

Erwin1966

Technical User
Oct 30, 2001
2
0
0
NL
With the commando: LOAD DATA LOCAL INFILE "data.txt" INTO TABLE database; you can put a lot of data into a mysql database. But where can the database find the text file. Where do I put this file so this works well? I also work with phpMyAdmin, but this programm is only for building databases. Is there also an application wich is easy to use for putting data into the database?
 
Are you giving the command in the server? You need the command when you are using the client server protocol of MySQL and are giving LOAD DATA to MySQL client.
I hope it works...
Unix was made by and for smart people.
 
2 ways:
If your are using cd to the directory wher the data file exists and at the terminal
mysql -u username passsword databasename
then :
LOAD DATA LOCAL INFILE "data.txt" INTO TABLE FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\'

Or you can point to the path wher the file lives:

LOAD DATA LOCAL INFILE "/some/damn/dir/on/yer/puter/data.txt" INTO TABLE FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\'

I prefer the first method....its easier. :)

See :


if your in windows go get mysql front
its a nice GUI for mysql


Let me knoe whow it turns out!

NixerX
 
Thanks for the tips. The program MySQLfront looks great! I 've downloaded it and now I'm going to give it a try.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top