MySQL server has gone away - in exactly 60 seconds

MySQL server has gone away - in exactly 60 seconds

  1. Blog
  2. 15 November 2026
  3. 1 min read

Stefan Bogdanescu

Founder & Senior Architect

MySQL server has gone away - in exactly 60 seconds

You are debugging a nightly job that suddenly started timing out after exactly 60 seconds, throwing a MySQL server has gone away error. The query runs fine from the command line but fails when called from your PHP application. You've already tried increasing wait_timeout, rebooted the server, and even checked the OS version. It's frustrating because the logic seems sound: you're using SLEEP(120) to simulate a long-running operation, yet the connection dies prematurely.

The culprit is almost certainly not a resource issue or a query optimization problem. When an error occurs at a fixed interval—specifically 60 seconds in this case—it points directly to a network-level timeout setting rather than a server-side execution limit.

The Real Timeout: net_read_timeout

While you might have adjusted the standard wait_timeout, which controls how long a connection is kept idle before the server closes it, that isn't the only timer at play. In your specific environment, the issue stems from the client's expectation to receive data versus the actual delivery time.

The variable net_read_timeout dictates how many seconds the MySQL client waits for the first packet of data after issuing a query. By default in many configurations (and often the case in older setups like MySQL 5.1), this value is set to 30 seconds. However, your error log shows the connection dying at 60 seconds

Our network