title: [Warning]: PDO::__construct(): MySQL server has gone away - wait_timeout not the cause?
body: <p>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:</p>
  
  <pre><code>[Warning]: PDO::__construct(): MySQL server has gone away (Database/class.SWIFT_Database.php:334)
  </code></pre>
  
  <p>I have tried setting the wait_timeout to the max value in the /etc/my.cnf file ie;</p>
  
  <pre><code>wait_timeout=31536000
  </code></pre>
  
  <p>Also from the mysql I have set the global wait_timeout to this value and set the session wait_time out to the same.</p>
  
  <p>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. </p>
  
  <p>Also this morning when I logged into the server and ran the following command, the session wait_timeout value had reverted!</p>
  
  <pre><code>mysql&gt; select @@global.wait_timeout, @@session.wait_timeout;
  +-----------------------+------------------------+
  | @@global.wait_timeout | @@session.wait_timeout |
  +-----------------------+------------------------+
  |              31536000 |                  28800 |
  +-----------------------+------------------------+
  1 row in set (0.00 sec)
  </code></pre>
  
  <p>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: <a href="http://dev.mysql.com/doc/refman/5.0/en/gone-away.html" rel="nofollow">http://dev.mysql.com/doc/refman/5.0/en/gone-away.html</a>) </p>
  
  <p>Any advice would be greatly appreciated. Server details and product versions below:</p>
  
  <p>Server: OpenSuse 11.4
  MySql Version:  5.1.53</p>
  
  <p>Many Thanks In Advance!</p>