I had a similar situation
Link ,
I also had to Insert into multiple Databases, Like some people have suggested
1. Bulk insert is fastest , write to a csv file and then do a load data infile to import the data
2. Use sqllite it is faster compared to mysql.
3 I am not sure but u can try this , You can Insert Into sqllite and then export to cvs and Import to Mysql (like i said im not sure about this but just a suggestion).
4. If it is speed you require , Write a C program.