Quickest way to Insert mass data Into Mysql database
mysql, php
Solution
Using one INSERT statement with multiple rows is faster than one INSERT statement per row. This will reduce calls to the database.
Example:
INSERT INTO tbl_name (a,b,c) VALUES(1,2,3),(4,5,6),(7,8,9);
Problem
I actually have a list of 100,000 records which I'd like to insert into the MySQL database. I have tried to insert them with `foreach` and simple `INSERT INTO` however it took a lot of time to insert even 100 row. Like 1 second / row. IS there any method to insert these rows much faster?