// MySQL error reference

MySQL error 1158: Error reading communication packets

The server got a read error on a client connection. Usually the client went away without closing it: a crash, a killed process or a network drop.

Error number
1158
Name
ER_NET_READ_ERROR
SQLSTATE
08S01
Category
Connection and client
Error message
Got an error reading communication packets

What it means

1158 is mostly seen in the server's error log as an aborted connection, not by the client. It means the server tried to read from the connection and the read failed. Occasional ones are normal; many of them point at clients that don't close connections or network problems.

Common causes

  • Application processes that exit or crash without closing their connections.
  • Network equipment dropping connections.
  • A packet larger than max_allowed_packet.

How to fix it

  1. Count aborted connections and see whether they keep rising.

    SHOW GLOBAL STATUS LIKE 'Aborted_%';
  2. Make applications close connections properly and pools recycle them; check the network between client and server if counts keep climbing.

Related errors

More connection and client errors

The code and message text are from the MySQL 8.4 Error Message Reference. Browse the full MySQL error list or search every database error.

// fewer errors, faster fixes

Work on MySQL in SQLly

A native SQL client for macOS, Windows and Linux with schema-aware IntelliSense, guardrails for risky statements and clear error messages, for MySQL and the other databases you use.