MySQL error 1159: Got timeout reading communication packets
The server waited longer than net_read_timeout for data from a client in the middle of a command, or a connection sat idle past wait_timeout.
- Error number
1159- Name
ER_NET_READ_INTERRUPTED- SQLSTATE
08S01- Category
- Connection and client
What it means
Like 1158, this is usually logged by the server as an aborted connection. A read from the client took longer than net_read_timeout (30 seconds by default), or an idle connection went past wait_timeout, so the server closed it.
Common causes
- Idle connections left open longer than
wait_timeout. - Clients that pause mid-command, for example while streaming
LOAD DATA LOCALover a slow link. - A slow or congested network.
How to fix it
-
Check the relevant timeouts.
SHOW VARIABLES WHERE Variable_name IN ('net_read_timeout', 'wait_timeout'); -
Raise
net_read_timeoutfor slow uploads, and have connection pools retire connections beforewait_timeout.SET GLOBAL net_read_timeout = 120;
Related errors
1158Error reading communication packets4031Disconnected by the server for inactivity2013Lost connection to MySQL server during query
More connection and client errors
2002Can't connect through socket2003Can't connect to MySQL server on host2005Unknown MySQL server host2006MySQL server has gone away2055Lost connection to MySQL server at stage2026SSL connection error2059Authentication plugin cannot be loaded2061Authentication plugin reported error
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.
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.