Not sure if this will help, as you said you already tried autocommit, but did you try to commit after creating the table, then doing all the inserts before commiting on disconnect? (I'm no MySQL or Python guru, but I do use it with python and MySQLdb .)