Error code:1153 Got a packet bigger than ' Max_allowed_packet ' bytes false hints.
The beginning did not notice, prompted a large pile, later saw this sentence
When you export MySQL data using the SQLyog tool, the export is not wrong when the data is large, but an error occurs when you import it. If you execute SQL separately, you will find the error code:1153 Got a packet bigger than ' Max_allowed_packet ' bytes errors.
For this problem you can add a line of max_allowed_packet=16m to the My.ini (set according to the actual situation).
Here we introduce the specific solutions
Depending on the profile, MySQL restricts the packet size that the server accepts.
Sometimes large inserts and updates are limited by max_allowed_packet parameters, resulting in failure.
View current configuration
Show VARIABLES like '%max_allowed_packet% '; The result shown is:
+--------------------+---------+ | variable_name | Value | +--------------------+---------+ | Max_allowed_packet | 1048576 | +--------------------+---------+
The above description is currently configured as: 1M
Modify method
1) Method 1
You can edit the my.cnf to modify (Windows My.ini), either in the [Mysqld] section or in the MySQL server configuration section.
Max_allowed_packet = 20M If no my.cnf can be found through
MySQL--help | grep my.cnf to find my.cnf files.
2) Method 2
Access to MySQL server
Running on the MySQL command line
Set global Max_allowed_packet = 2*1024*1024*10 then shut down this MySQL server link and re-enter.
Show VARIABLES like '%max_allowed_packet% '; see if Max_allowed_packet edited successfully
Note: No matter what operating system you are in, after setup we need to restart the MySQL server before it can take effect.