Installing and using MySQL driver in Linux
Optimizing INSERT performance
Unfortunately mysqld can be quite slow when INSERTing large numbers of rows.
We found the hint from this Stackoverflow article quite effective:
innodb_flush_log_at_trx_commit setting should be set to 2 (in the
[mysqld] section of
Unfortunaltely the MySQL server has to be restarted for this change to take effect.