Importing 100mb of plain text into a mysql database

Soldato
Joined
4 Jul 2004
Posts
2,647
Location
aberdeen
Hello,
I have a LONG list of items i need to put into a database.

It is like this:

example word another example word
new entry
another entry this one is a little bit longer than the other two
etc etc

The database has two fields, id and sentence. id auto increments so i don't need to put that in

How can i easily import it? At the moment the best i've found is running a macro to replace the words with insert into `table` ('key') ('sentennce one'),('etcetc');

But it is taking forver. I've so far moved about 2 pixels down on the scroll bar, in the program I am using (textpad).

Is there any easy way to import it?
 
Do you have access to the 'LOAD DATA INFILE' method? You might need the command line (ie, SSH access) to do it - it's about the only way.

Upload it (FTP) and ask your host :)
 
Hi
Well i am planning on just using it on a local server, so yeah.
How would I go about doing this? Would I need actual command line access, or could I just use an sql query within phpmyadmin?
 
Command line, though as it's local phpmyadmin might work - you'd just have to set high values for max memory times / script time etc.

Far better to do from command line - see here :)
 
Hmm. I have no idea how to do that!
Is there an easier way? Perhaps by writing a php script, that doesn't require a file uploaded or something?
 
Back
Top Bottom