Issue
The following dashboard alert appears in the source database:
java.lang.RuntimeException: com.mysql.cj.jdbc.exceptions.PacketTooBigException:
Packet for query is too large ( current size [size in kbytes] > allowed size [size in kbytes]).
You can change this value on the server by setting the 'max_allowed_packet' variable.
Environment
Connector: MySQL
Resolution
This particular error indicates that the size of the packet of the data sent from your database is being greater than allowed on the source configuration.
A communication packet is a single SQL statement sent to the MySQL server, a single row that is sent to the client, or a binary log event sent from a master replication server to a slave.
Example
java.lang.RuntimeException: com.mysql.cj.jdbc.exceptions.PacketTooBigException:
Packet for query is too large (e.g. 8,339,215 > e.g. 4,194,304).
You can change this value on the server by setting the 'max_allowed_packet' variable.
The packet for query is too large e.g. (current size:8,339,215
> allowed: 4,194,304
).
Solution
You can set the value higher on the source database by setting the max_allowed_packet
variable to accept the higher value. The default max_allowed_packet variable
value is 1MB.
You can check the current value of max_allowed_packet in your source DB by running the following query
SHOW VARIABLES LIKE max_allowed_packet;
Run the following command query in your source db to increase the value to 16M or 32M (higher if required):
$> mysql --max_allowed_packet=32M
For more information, please visit: MySQL Official Documentation on 'Packet Too Large'.
Cause
-
Either a query, row, or a binary log event are greater than 1mb.
- Connector Sync Failure due
Packet for query is too large
.