Is there a way to configure the timeout for inactive clients with mysql?
Example:
A MySQL DB has a limit of 100 client connections but some clients are not using the connection any more. I assume MySQL will eventually drop the connection but is this configurable?
Best Answer
There are a number of
...timeout...
parameters that can be configured for a MySQL instance. Here are a few selected parameters (Ver. 8.x) for your convenience:Reference: 5.1.7 Server System Variables (MySQL | Documentation)
interactive_timeout
wait_timeout
Answering Your Question
It depends. Globally you can define a timeout with the
wait_timeout
parameter of your MySQL instance. If you are using the specific optionCLIENT_INTERACTIVE
of themysql_real_connect()
function, then you can use theinteractive_timeout
parameter.