Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a mySQL connection time limit?

Tags:

mysql

perl

I'm using Net-SNMP on an Ubuntu 14.04 server to capture SNMP traps in snmptrapd, which I've set up (using "perl do '/path/to/traphandler.pl'" in the /etc/snmp/snmptrapd.conf) to call a Perl::DBI script to insert data into a mySQL database. Everything has been running fine since 16th March, then about 9am yesterday (6th April - Bank Holiday - typical) the database updates stopped, though the syslog shows that the traps were still coming in.

I can't see anything obvious in /var/log, so I'm wondering whether the database connection simply expired and closed. Does that happen? I stopped and restarted snmptrapd and it all started working again, which makes me think that was the cause. How would I check?

like image 552
kbro Avatar asked Dec 19 '22 05:12

kbro


1 Answers

Yes it is 28800 seconds

connect_timeout=28800
wait_timeout=28800
interactive_timeout=28800

You can set the values in /etc/my.cnf

If you want to change it then you have to run this query:

SET GLOBAL interactive_timeout = 100;  //Change it if you want
SET GLOBAL wait_timeout = 100;
like image 184
Rahul Tripathi Avatar answered Jan 08 '23 01:01

Rahul Tripathi