Page 1 of 1

Bulk insert

Posted: Mon 11 Apr 2011 15:35
by miguelenguica
Hi. I have a text file with 500.000 inserts in SQL.

"insert into knowledge_2('knowledge_id','phrase_id','word_text') value(4,15,'user');"

What's the fastest way to insert them into a MySQL table? I've tried MyDump but the result was very slow. Must I write anything else into the SQL file to make it perform bulk inserts?

MyLoader is not an option. Can you help?

Thanks.

Posted: Tue 12 Apr 2011 07:34
by AndreyZ
Hello,

Please try using transactions and the TMyDump component in the following way:

Code: Select all

MyDump.Connection.Open;
MyDump.Connection.StartTransaction;
MyDump.RestoreFromFile('your_filename');
MyDump.Connection.Commit;