Let’s see how to fix the “MySQL server has gone away” error that appears when accessing MySQL Server.
The most common causes of the MySQL server has gone away
error are:
- Packet size too large in MySQL query (default maximum packet size is 16 MB);
- You ran out of free RAM on the MySQL host (you can check the free memory in Linux using the free –h command;
- The inactive connection between your application/script and MySQL (by default, the session disconnects after 8 hours).