Answer the question
In order to leave comments, you need to log in
MySQL server has gone away, where to dig?
Good afternoon.
When developing the project, I encountered the following problem: the MySQL server has gone away error periodically falls out.
How to deal with it and where to dig?
PHP, MySQL via PDO, Debian
Crashes intermittently on a simple UPDATE query on a single record in a table with about a million records. That is, sometimes the update takes 1 ms, sometimes 5, and sometimes everything ends with an error.
If you catch an exception and execute the request again, everything passes, but these are some half-measures.
Answer the question
In order to leave comments, you need to log in
The reasons may be different. When I encountered this, one of two things helped me:
1. If you use a database connection pool (I don’t remember what it’s called in PDO, it seems like a persistent connection or something like that ...), then try disabling it
2. In the settings muskla try to increase the max_allowed_packet parameter
But to be honest, I'm not sure if this is your case, although anything can be
service mysql restart
Log into phpmyadmin as root and open the processes tab. There you can see sql queries that slow down
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question