Solution for importing SQL files from mysql is too large or connection timeout

Source: Internet
Author: User

Solution for importing SQL files from mysql is too large or connection timeout

When I was on a business trip for development in the field some time ago, there was always a problem with importing databases. Finally, we found a magic SQL statement for implementation. If an import error occurs, we can execute the following statement. So far, it has been a trial.

Set global max_allowed_packet = 100 000 000; set global net_buffer_length = 100000; set global interactive_timeout = 28800 000; set global wait_timeout = 28800000
Explanation of the preceding statement:

-Max_allowed_packet = maximum size of the cache for communications between the XXX client/server;

-Net_buffer_length = XXX TCP/IP and socket communication buffer size, create line with length up to net_buffer_length

Interactive_timeout = 10; valid for subsequent interaction links;

Wait_timeout is valid for the current interactive link;

========================================================== =====

The preceding statement mainly solves the following problems: Connection timeout and the imported SQL file is too large.

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.

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.