First, the problem phenomenon
Packet for query is too large (6,296,032 > 4,194,304). You can change this value on the server by setting the ‘max_allowed_packet’ variable
Check the max_allowed_packet
show VARIABLES like '%max_allowed_packet%';
Copy the code
Second, solutions
1. Open the my.ini file
In Windows, the directory where this file resides is hidden. Therefore, you need to set the hidden directory to view first
The my.ini file is located in C:\ProgramData\MySQL\MySQL Server 8.0
2. Modify max_allowed_packet
Search for max_allowed_packet in the my.ini file and change it to the size you want
3. Restart the mysql service
In Windows services, find MySQL, right-click and choose Restart
4. Check max_allowed_packet again
It’s been modified. Call the service again. OK.