SQLyog Recovery Database Error Resolution "Error Code:2006-mysql server has gone away"

Source: Internet
Author: User

8693044

SQLyog error when importing the database.

Error Code:2006–mysql server has gone away

Searched, said to be Max_allowed_packet (a parameter of MySQL) set the value is not large enough.

Then I'll just change it.

In Windows:

In the MySQL Server installation directory,
In My.ini file, add the following line under [mysqld] on SERVER section.

Max_allowed_packet = 16M

In Linux:

Copy the my-xxx.cnf file From/usr/share/mysql to/etc as My.cnf

XXX can be small, medium, large, huge ... depending on the requirement.

$ cp/usr/share/mysql/my-xxx.cnf/etc/my.cnf

In the my.cnf file, change the default
Max_allowed_packet = 1M
To
Max_allowed_packet = 16M

Save the file and restart MySQL server.

The error code:2006–mysql server has gone away errors when importing the. sql file today is that the imported SQL file is larger than the default Max_allowed_packet value of the system, and a lot of changes have been made to the configuration file. However, the My.cfg file is not found, and modifying other files is not used, so the SQL statements are used directly to modify:

SET GLOBAL max_allowed_packet=67108864;

This is very good, do not restart the service after the change, directly to the

SQLyog Recovery Database Error Resolution "Error Code:2006-mysql server has gone away"

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.