Thursday, October 24, 2013

max_allowed_packet error in mysql

Caused by: java.sql.BatchUpdateException: Packet for query is too large (1434172 > 1048576). You can change this value on the server by setting the max_allowed_packet' variable.

The max_allowed_packet variable can be set globally by running a query.
However, if you do not change it in the my.ini file (as dragon112 suggested), the value will reset when the server restarts, even if you set it globally.

To change the setting for everyone until the server restarts:
SET GLOBAL max_allowed_packet=1073741824;

No comments:

Post a Comment

Create MongoDB service in Windows OS

1) Open Command Prompt 2) Create directory for Database and Logs                    mkdir c:\data\db                     mkdir c:\...