1153
MySQLERRORNotableResource LimitHIGH confidence

Got a packet bigger than 'max_allowed_packet' bytes

What this means

Error 1153 (SQLSTATE 08S01) occurs when the client sends a query or data packet larger than the server's max_allowed_packet setting. This is commonly triggered by inserting large BLOB or TEXT values, or by LOAD DATA INFILE with very large rows.

Why it happens
  1. 1Inserting a BLOB or LONGTEXT column with a value larger than max_allowed_packet
  2. 2A single INSERT statement with many rows whose total size exceeds max_allowed_packet
  3. 3mysqldump --single-transaction produces a large INSERT that exceeds the destination server's limit on import
How to reproduce

A large BLOB is inserted and exceeds the default max_allowed_packet.

trigger — this will error
trigger — this will error
-- max_allowed_packet default is 16MB in MariaDB 10.x
-- Insert a value larger than max_allowed_packet:
INSERT INTO files (data) VALUES (REPEAT('x', 20 * 1024 * 1024));  -- 20 MB

expected output

ERROR 1153 (08S01): Got a packet bigger than 'max_allowed_packet' bytes

Fix

Increase max_allowed_packet

WHEN When large BLOB values are a legitimate use case.

Increase max_allowed_packet
-- Session-level (takes effect immediately for this connection):
SET GLOBAL max_allowed_packet = 64 * 1024 * 1024;  -- 64 MB

-- Or in my.cnf for persistence:
-- [mysqld]
-- max_allowed_packet = 64M

Why this works

max_allowed_packet controls the maximum size of a single client-server communication packet. Raising it allows larger individual statements. The server must be restarted for my.cnf changes to take effect; SET GLOBAL is immediate but not persistent.

What not to do

Set max_allowed_packet to 1G as a general practice

Very large packet sizes increase the risk of memory exhaustion on the server when many concurrent connections each send large packets.

Version notes
MariaDB 10.2+

Default max_allowed_packet is 16MB. Maximum allowed value is 1GB.

Sources
Official documentation ↗

MariaDB Server error code 1153 / ER_NET_PACKET_TOO_LARGE

MariaDB max_allowed_packet

Content generated with AI assistance and reviewed for accuracy. Found an error? hello@errcodes.dev

← All MySQL errors