MySQL Import data slow solution

Source: Internet
Author: User

Import Note points:
Importing with tools such as phpMyAdmin or navicat is still quite slow and can be imported directly using MySQL
The import command is as follows: mysql>-uroot-psupidea jb51.net<E:\www.jb51.net.sql We can do it.
Description mysql>-u mysql user name-p mysql password to import to the database name < SQL file path to import MySQL
This way the import will be very fast, and the SQL that was imported in the last few hours can now be completed in a few 10 seconds.

when exporting, note the point:
- e
Use the multiple-line insert syntax that includes several values lists;
--max_allowed_packet= The maximum size of the buffer for the communication between the XXX client/server;
--net_buffer_length= XXX TCP/IP and socket communication buffer size, create a line of length up to net_buffer_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:
mysql>mysqldump-uroot-psupidea jb51.net goodclassification-e--max_allowed_packet=1048576-- net_buffer_length=16384 >www.jb51.net.sql

MySQL Import data slow solution

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.