How to import Mysqldump into the database is slow

Source: Internet
Author: User
1. the SQL statement exported by MySQLdump is quite slow when it is imported to other databases, or even dozens of seconds before processing an SQL statement. After repeated tests, two parameters are found to affect the import speed ;&..

1. the SQL statement exported by MySQLdump is quite slow when it is imported to other databases, or even dozens of seconds before processing an SQL statement. After repeated tests, two parameters are found to affect the import speed ;&..

1. the SQL statement exported by MySQLdump is quite slow when it is imported to other databases, or even dozens of seconds before processing an SQL statement. After repeated tests, two parameters are found to affect the import speed;

-- Max_allowed_packet = ***** maximum size of the cache area for client/server communication;
-- Net_buffer_length = ***** the size of the TCP/IP and socket communication buffer, and the row with the length of net_buffer_length is created.


When exporting data, use the-e Option to set the preceding two values. Note that the export values of max_allowed_packet and net_buffer_length cannot be greater than those of the target database;

Refer to the database parameter values and use the following command;

Mysql> show variables like 'max _ allowed_packet ';

Mysql> show variables like 'net _ buffer_length ';


Export data by referring to the queried target data parameters;

# Mysqldump-uroot-p *** original database-e -- max_allowed_packet = 4194304 -- net_buffer_length = 16384> file. SQL

This article is from the "Luo laosan's O & M path" blog. Please keep this source

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.