What is the best way to load 1,600,000 rows of data into a mysql database?

This may sound silly, but yes, I need an effective way to do this. I am using php at the moment and the person is slow.

Any pointers please.

Greetings.

+3
source share
3 answers

Anytime I have to insert huge amounts of data, I try to use "LOAD DATA INFILE":

http://dev.mysql.com/doc/refman/5.1/en/load-data.html

A bottleneck could also be data indexing. I would recommend disabling indexing before starting infile data loading, and then turning it on later.

+4
source

HediSQL http://www.heidisql.com/. , . , . mysql mysql , phpMyAdmin.

0

Try removing all indexes before inserting. Once you have inserted everything, re-create the indexes.

There is a really good article on MySql about this and other methods. Look at it here .

0
source

Source: https://habr.com/ru/post/1752614/


All Articles