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

Source: Internet
Author: User
Tags error code mysql import

To some small script that rarely complains, 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, the original is MySQL import mass data exceeded the default allow the largest packet so prompted 2006-mysql server has gone away

So find my.cnf, in [mysqld] add:

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

Maximum allowable packet 300M, wait timeout/activity failure often 200,000 seconds, restart MySQL

The code is as follows Copy Code
[Root@lizhong 20140323]#/etc/init.d/mysqld Restart
Shutting down MySQL .... success!
Starting MySQL. success!

Re-import again, all normal!

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.