M
M
MasterCopipaster2021-07-01 02:06:06
MySQL
MasterCopipaster, 2021-07-01 02:06:06

General error: 2006 MySQL server has gone away on a resting WTF server?

I ran into a strange thing, I have a MySQL server installed on Windows Server 2019
There is no load on the server (because there is only 1 client there)
From time to time there is such a problem (I suspect that this happens when you do not access mysql for a long time - but this is not a confirmed fact).
The following error pops up:

General error: 2006 MySQL server has gone away

If you repeat the request after a couple of seconds, then everything is ok.

I googled - and all I found is that this error happens when you try to insert a large query with a bunch of data.
But this is absolutely not my case.

For example, my request looks like this:

SELECT
  *
FROM
  `user` t0
WHERE
  t0.m_code = ?
  AND t0.is_verified = ?
LIMIT 1

Data:
"12c9fe68-c781-41a0-b686-9e116e828712", "1"


somehow weakly pulls on a large request, for the base in which there are 2 records ...

Actually, who faced such a thing and how can it be treated?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
SKEPTIC, 2021-07-01
@pro100chel

The muscle breaks the connection by timeout if there are no requests.
There are 2 solutions.
1. Ping the server with simple garbage requests once in a certain period of time.
2. Increase the timeout value in the config. Here it is described how to do it on linux

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question