When importing SQL files into the MySQL database, if the file is too large (hundreds of m), you will be prompted "Error code:1153-got a packet bigger than ' Max_allowed_packet ' bytes"
1. View Current Database configuration
Show VARIABLES like '%max_allowed_packet% ';
Displays the following results
+--------------------+---------+
| variable_name | Value |+--------------------+---------+| Max_allowed_packet | 1048576 |+--------------------+---------+ Description The current configuration is: 1048576/1024/1024 = 1M 2. Modify the "Max_allowed_packet" in the My.ini file The value path is in the MySQL installation directory
3. After the change, restart the MySQL service
In the cmd window, execute the net stop MySQL first, and then the net start MySQL
Then go to SQLyog to execute show VARIABLES like '%max_allowed_packet% '; Discovery value changed
MySQL database when importing SQL file "Error code:1153-got a packet bigger than ' Max_allowed_packet ' bytes ' workaround