hello everyone !
how can I handle the mysql / mariadb timeout efficiently?
* an alternative is to create a thread, and every X milliseconds, it runs a simple query to keep the connection alive, is there another way more efficient?
DriverVersion : MariaDB Connector/C 3.0.9
MySQL Timeout problem ?
- captain_skank
- Enthusiast
- Posts: 636
- Joined: Fri Oct 06, 2006 3:57 pm
- Location: England
Re: MySQL Timeout problem ?
That's exactly what I did, but I have been using an ODBC connection and the thread runs every 15 minutes.
Seems to work and has been doing so an a daily basis for the last 6 years
I don't know if this applies to the built in MySql/MariaDb connectivity though as i'v enot used it for anything usefull yet.
Seems to work and has been doing so an a daily basis for the last 6 years
I don't know if this applies to the built in MySql/MariaDb connectivity though as i'v enot used it for anything usefull yet.
Re: MySQL Timeout problem ?
Hi skinkairewalker,
You might want to consider solving the problem at the database level. If you are the owner of the database, you can change the session timeout yourself. Otherwise, you can ask the database administrator to change it for you.
In either case, you can find the amount of time allocated to your session by running this command in a MySQL client:
Then, pay attention to the "wait timeout", "interactive timeout", "net read timeout" and "net write timeout". But, pay special attention to "wait timeout", which is usually set to about 8 hours.
Here are a couple of useful resources to review:
https://dba.stackexchange.com/questions ... ns-running
https://confluence.atlassian.com/stashk ... 76189.html
You might want to consider solving the problem at the database level. If you are the owner of the database, you can change the session timeout yourself. Otherwise, you can ask the database administrator to change it for you.
In either case, you can find the amount of time allocated to your session by running this command in a MySQL client:
Code: Select all
show variables like '%timeout';
Here are a couple of useful resources to review:
https://dba.stackexchange.com/questions ... ns-running
https://confluence.atlassian.com/stashk ... 76189.html