Somewhere in here, autocommit has to be set to false by default otherwise bulk inserts are painfully slow: http://stackoverflow.com/questions/6482004/pythonmysql-bulk-insert