Reference large amount of data inserted mysql

Mysql million data records 10 seconds bulk insert just three steps
The first step: the configuration file my.ini
file configuration bulk_insert_buffer_size = 120M or more of the maximum length to insert statements. Max_allowed_packet = 1MNet_buffer_length = 8k save
Step Two: Set View candidacy has not entered into force.
Mysql> SHOW VARIABLES;
bulk_insert_buffer_size default is 8M, we put it into a 100M or more megabytes, do not be too big.
Third step: After completion of setting, the batch mode using a plurality of insert data.
INSERT INTO table (field1, field2, field3) VALUES ( 'a', "b", "c"), ( 'a', "b", "c"), ( 'a', "b", "c ");

Guess you like

Origin www.cnblogs.com/gered/p/11313086.html