MySQL rejects a communication packet that exceeds the active max_allowed_packet limit and can close the connection. Large SQL statements, rows containing large binary/text data, and imports can trigger this condition.
- Check the exact database error for
packet too large,max_allowed_packet, or a lost connection during a large query. - Reduce the size of each import batch or SQL statement when the tool supports chunking.
- Regenerate the export with smaller statements when supported, and verify that the import tool can process it correctly.
- Do not change unrelated PHP upload limits if the upload succeeds and the failure occurs only after MySQL begins processing the data.
The server-side packet limit may be outside the controls available to a normal hosting account.
Compressing the uploaded dump reduces transfer size, not the size of the SQL statement MySQL receives after decompression. Reduce oversized statements with a tool that safely batches the data; do not split SQL at arbitrary byte boundaries.
Documentation for this guidance: dev.mysql.com — packet too large.