G
G
Georg2014-03-31 15:28:45
PHP
Georg, 2014-03-31 15:28:45

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

3 answer(s)
V
Vit, 2014-03-31
@fornit1917

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

E
Eugene, 2014-03-31
@Nc_Soft

You don't have a digital ocean virtual machine by any chance?

V
Volodymyr Godyak, 2014-10-15
@wmgodyak

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 question

Ask a Question

731 491 924 answers to any question