If you experience com.mysql.jdbc.PacketTooBigException exception when querying MySQL, it hints that the packet size of your requesting is smaller than the current packet size in MySQL server setting.

To increase the packet size, you can set bigger value to max_allowed_packet.

Example, I set a bigger max_allowed_packet value in /etc/my.cnf file so that the new value takes effect on the server-wide environment. The new value 10485760 is a customized value which depends on your actual requirement.



Leave a Reply

Your email address will not be published.