MySql Packet for query is too large solutions to problems

MySQL Server will limit the packet size accepted. Sometimes insert, update or query the size of the data packet will be affected by max_allowed_packet parameter limits, the operation fails. Error message:

Caused by: com.mysql.jdbc.PacketTooBigException: Packet for query is too large (XXXX > YYYY). You can change this value on the server   
by setting the max_allowed_packet' variable 

Use the following command to see the size of max_allowed_packet parameters:

show VARIABLES like '%max_allowed_packet%';

Solutions, modify my.ini file, add or modify the max_allowed_packet parameter in the [mysqld] under:

max_allowed_packet = 50M

After modifications need to restart the mysql service

Guess you like

Origin www.cnblogs.com/oliverreal/p/11349542.html