ID: 13589 Comment by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] Status: Closed Bug Type: MySQL related Operating System: RedHat 7.1 PHP Version: 4.0.6 Assigned To: zak New Comment:
I have the same problem running version 4.2.3 on a FreeBSD 4.6.2. And I check the problem running this script: <? $con = mysql_connect('localhost','user','pass'); mysql_select_db('midb',$con); $q = "Select * from categorias order by nombre limit 5"; $res = mysql_query($q,$con); while($r = mysql_fetch_array($res,$con)) { print "<p>".$r['nombre']."</p>"; } print "<hr>"; $q = "Select * from vinculos order by nombre limit 5"; $res = mysql_query($q,$con); while($r = mysql_fetch_array($res,$con)) { print "<p>".$r['nombre']."</p>"; } print "<hr>"; mysql_close($con); ?> and checking the mysql client console with: mysql> show status like "%onnection%"; and Max_used_connections incrementes like if the mysql_close didn't exists. Previous Comments: ------------------------------------------------------------------------ [2002-07-10 09:27:26] [EMAIL PROTECTED] To fix this problem, you should set your mysql-server variable timeout_interactive to the number of seconds (default is 28800). For pconnect use the optional 4th parameter client_flags: mysql_pconnect($host, $user, $pass, MYSQL_CLIENT_INTERACTIVE); This allows interactive_timeout seconds (instead of wait_timeout seconds) of inactivity before closing the connection. This new optional parameter is available in the latest CVS-tree. ------------------------------------------------------------------------ [2001-12-31 19:16:22] [EMAIL PROTECTED] doh. ------------------------------------------------------------------------ [2001-12-31 19:08:34] [EMAIL PROTECTED] Assigning to myself ------------------------------------------------------------------------ [2001-11-20 12:55:15] [EMAIL PROTECTED] However, this is something else. This need to be investigated first. ------------------------------------------------------------------------ [2001-11-20 12:31:00] [EMAIL PROTECTED] This is what Derick said about this (in #14149): This is not a bug, the MySQL extension will open a new connection if the _current apache child_ has no open connection to MySQL. With this in mind, it's very normal to see that apache has multiple connections open to MySQL. ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/13589 -- Edit this bug report at http://bugs.php.net/?id=13589&edit=1