P
P
PHP-GOD2021-06-20 02:34:20
MySQL
PHP-GOD, 2021-06-20 02:34:20

Why after some time of idle connection to MySql server there is an error at request?

I use the MySql API for C. Everything connects fine and all requests are correctly sent, but if I wait 2-3 days without sending requests to the database, and then still send the request, I get an error from the API:

CDK Error: no such file or directory (generic:2)

As far as I understand, somewhere there is a setting responsible for the maximum lifetime of a session (or its activity in the query plan). What needs to be changed so that even after a long period of inactivity, it can still send requests correctly?

I found several properties that are possibly related to this:

interactive_timeout
wait_timeout


What are the best values ​​for them? Although in my case, it is better to make the session lifetime unlimited.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Gornostaev, 2021-06-20
@sergey-gornostaev

It is better not to increase the lifetime of the connection, but to check its activity and reconnect.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question