I need to speed up the import of a sql.gz file into mysql. I have turned off foreign key checking and followed this page .
Is there a way to make the export file (the sql.gz) from mysqldump user multi-insert statements like this:
INSERT INTO yourtable
VALUES (1,2), (5,5), ...;
so that the bulk loading process will be much faster?
mysqldump does this by default. There are many other options (such as use REPLACE or INSERT IGNORE as opposed to the default INSERT command) run mysqldump --help to see the list.
You might try LOAD DATA INFILE to see if that is faster. That will read the data from a tab delimited text file without any INSERT commands. You would use SELECT ... INTO OUTFILE 'file_name' as one way to create this data file.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.