Mysql prompts MySQL server has gone away import error 2006

Source: Internet
Author: User

An error is always prompted when importing SQL statements today.

The code is as follows:

ERROR 2013 (HY000): Lost connection to MySQL server during query

ERROR 2006 (HY000): MySQL server has gone away

No connection. Trying to reconnect...

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql. sock' (111)

ERROR:

Can't connect to the server

Solution 1

Use mysqldump to export and add the parameter -- skip-extended-insert

Solution 2


If the problem persists, let's take a look at the following:

Find the my. ini configuration file in your mysql directory and add the following code:

Max_allowed_packet = 500 M

Wait_timeout = 288000

Interactive_timeout = 288000

I can change the value based on the actual situation. I will directly change the value to a large value and remember to restart your mysql service.

In this way, the MySQL server has gone away problem can be effectively solved. In fact, it is caused by a large amount of data. Method 2 can also solve this problem.

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.