1153ERRORTier 2 — Caution✅ HIGH confidenceGot 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
- 1Inserting a BLOB or LONGTEXT column with a value larger than max_allowed_packet
- 2A single INSERT statement with many rows whose total size exceeds max_allowed_packet
- 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.
-- 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 MBFix 1: Increase max_allowed_packet
When large BLOB values are a legitimate use case.
-- 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 = 64MWhy 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
Why it's wrong: 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 docs: https://mariadb.com/kb/en/server-system-variables/#max_allowed_packet
🔧 Source ref: MariaDB Server error code 1153 / ER_NET_PACKET_TOO_LARGE
📖 Further reading: MariaDB max_allowed_packet
Confidence assessment
✅ HIGH confidence
Stable and well-documented.
See also
🔗 Related errors
📄 Reference pages