MySQL Import slow

Source: Internet
Author: User

Tags: dump record values multiline max. SQL Variables DCL SQL statement

MySQL exported SQL statements are likely to be very, very slow to import, having experienced an import of only 450,000 records for nearly 3 hours. Reasonable use of several parameters during export can greatly speed up the import.

-e uses multi-line insert syntax that includes several values lists;
--max_allowed_packet=xxx the maximum size of the buffer between client/server communication;
--net_buffer_length=xxx TCP/IP and socket communication buffer sizes, creating rows up to net_buffer_length length.

Note: Max_allowed_packet and net_buffer_length cannot be larger than the target database setting, otherwise there may be an error.

First determine the parameter values of the target library

Mysql>show variables like ' max_allowed_packet ';
Mysql>show variables like ' net_buffer_length ';

Write mysqldump commands based on parameter values, such as:

Mysqldump-uroot-p eis_db goodclassification-e--max_allowed_packet=1048576--net_buffer_length=16384 >good3.sql

MySQL Import slow

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

Tags Index: