27 Jul
2007
27 Jul
'07
1:48 a.m.
2007/7/26, Pavel Bastov <pbastov@gmail.com>:
Hi all,
I'm using MySQL database in my server app. Pretty often after some inactivity I get this message in my logs "MySQL server has gone away". How can I prevent this?
TIA
U can use Mysql::Ping(dbh) to keep the connection alive. ----------- n = mysql::Ping(dbh) Checks whether or not the connection to the server is working. If it has gone down, an automatic reconnection is attempted. Clients that remain idle for a long while, to check whether or not the server has closed the connection and reconnect if necessary can use this function. Returns true if the server is alive and false if an error occurred.