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"