Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Database input speed question

by DigitalKitty (Parson)
on Jul 31, 2003 at 17:51 UTC ( [id://279688]=note: print w/replies, xml ) Need Help??


in reply to Database input speed question

Hi jjhorner.

Good question. If you are running mySQL, you can use two primary tools. From the mySQL prompt enter:
mysql> LOAD DATA LOCAL INFILE "filename.txt" INTO TABLE tablename

Since mySQL isn't case sensitive, you need not use the same uppercase style as I did. The filename must be the same as the name of the table. Example:
mysql> LOAD DATA LOCAL INFILE "monks.txt" INTO TABLE monks

There must be no 'extra' characters before the .filetype. If so, mySQL will try to insert the data into the wrong table. The other tool is called 'mysqlimport' and it acts as a command line interface to LOAD DATA.

It works like this:
(system prompt) mysqlimport --local database_name datafile.txt


Hope this helps,
-Katie

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://279688]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (7)
As of 2024-04-23 16:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found