Error code

MySQL 2006

MYSQL2006
Database Error Code· An error code returned by a database server such as PostgreSQL or MySQL.

What it means

MySQL server has gone away — the server closed the connection mid-query.

How to fix it

  1. Increase wait_timeout and interactive_timeout in my.cnf.
  2. Increase max_allowed_packet if large BLOBs or long queries are being sent.
  3. Implement automatic reconnection or connection validation (ping before use) in the application.

Not affiliated with MySQL. Answer summarized from the manufacturer's manual linked above; consult that source for the authoritative procedure.