bulk insert to mysql

Apr 27 2010 9:58 AM
Hello.

I am fairly new to MySql but am looking for a way to speed up my inserts. I've earlier used bulkinsert to insert fast into MS SQL but we are looking at migrating to MySQL and the simple insert (for each(DataRow row in DataTable.Rows) takes way too long.

I will insert (approx 2 times/day) a few hundred thousand rows to remote servers. And several of them.

I've searched all over the web to find an easy way to do this without much success. In my testcase I insert about 200 000 rows and it takes about 15 minutes to a remote server.

Is there an eqvivalent to bulkinsert to use against mysql db? Or is the best way to first write it to a file and then use a sql procedure for the insert? I would prefer the first method but performance is most important.

Thanks for any tips!
Best regards,
Joakim.

Answers (1)