title: PHP mysql_connect set wait_timeout
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/1644432/mysql-server-has-gone-away-in-exactly-60-seconds">MySQL server has gone away - in exactly 60 seconds</a>  </p>
  </blockquote>
  
  
  
  <p>We're using the mysql_connect method in PHP to create database handles for a daemon.  The problem is, that connection might not be used for more than 8 hours (sometimes for more than a few weeks.)</p>
  
  <p>We're running into issues where MySQL will end the session because the wait_timeout is reached.
  <a href="http://dev.mysql.com/doc/refman/5.0/en/gone-away.html" rel="nofollow noreferrer">http://dev.mysql.com/doc/refman/5.0/en/gone-away.html</a></p>
  
  <p>We don't want to increase this value for ALL connections.  Is there a way to increase the timeout for that handle only through PHP?  Through MySQL?</p>