I am hoping that someone on here can help with an issue I am having on a webserver. Currently the server hosts a web application which we have purchased for helpdesking. Every 8 hours when someone navigates to the page they will be presented with this error:
[Warning]: PDO::__construct(): MySQL server has gone away (Database/class.SWIFT_Database.php:334)
I have tried setting the wait_timeout to the max value in the /etc/my.cnf file ie;
wait_timeout=31536000
Also from the mysql I have set the global wait_timeout to this value and set the session wait_time out to the same.
I have noticed some strange behaviour, when you restart the mysql service, the wait timeout resets to the 28800 default, despite it being set in the my.cnf. I can't find any other config files for mysql though happy to look if someone can point me in the direction.
Also this morning when I logged into the server and ran the following command, the session wait_timeout value had reverted!
mysql> select @@global.wait_timeout, @@session.wait_timeout;
+-----------------------+------------------------+
| @@global.wait_timeout | @@session.wait_timeout |
+-----------------------+------------------------+
| 31536000 | 28800 |
+-----------------------+------------------------+
1 row in set (0.00 sec)
I see that this is an issue for a lot of people online with various webapps running on mysql, but no one seems to have a fix. A lot of advice online points to the wait_timeout but it doesn't seem to be changing the bug that I am seeing. I have tried out the fixes on the mysql manual about this issue, but still no luck (link: http://dev.mysql.com/doc/refman/5.0/en/gone-away.html)
Any advice would be greatly appreciated. Server details and product versions below:
Server: OpenSuse 11.4 MySql Version: 5.1.53
Many Thanks In Advance!