MySQL Import SQL script error: 2006-mysql server has gone away

Source: Internet
Author: User
Tags mysql import

Below I give you the introduction of the database in MySQL to prompt MySQL server has gone away problem resolution method, if you encounter MySQL prompt MySQL server has gone away error we can enter the reference.

As some small scripts rarely error, but recently imported a 10+m SQL script, but repeated the error:

Error occured at:2014-03-24 11:42:24
Line no.:85
Error Code:2006-mysql server has gone away

Finally found the reason, originally is MySQL imports the large amount of data when the default allows the largest packet, so the prompt 2006-mysql server has gone away

Then found MY.CNF, in [Mysqld] joined:

The code is as follows Copy Code
max_allowed_packet=300m
wait_timeout=200000
Interactive_timeout = 200000

The maximum allowable packet 300M, wait timeout/activity expires 200,000 seconds often, restart MySQL

The code is as follows Copy Code
[Email protected] 20140323]#/etc/init.d/mysqld restart
Shutting down MySQL .... success!
Starting MySQL. success!

Re-import again, everything is OK!

MySQL Import SQL script error: 2006-mysql server has gone away

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.