Bug 236554

Summary: mysql server does not honor the default wait_timeout variable.
Product: Red Hat Enterprise Linux 5 Reporter: Dragan Milivojevic <galileo.spam>
Component: mysqlAssignee: Tom Lane <tgl>
Status: CLOSED WORKSFORME QA Contact: David Lawrence <dkl>
Severity: low Docs Contact:
Priority: medium    
Version: 5.0CC: byte, hhorak
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-04-28 16:08:12 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Dragan Milivojevic 2007-04-16 12:41:28 UTC
rpm -q mysql-server
mysql-server-5.0.22-2.1
Packager    : Red Hat, Inc.

show variables shows that wait_timeout is set at 28800. Actually it is somewhere
around 
10 sec. 

Small test

<?php
	require_once ("db.config.php");
	$link = mysql_connect($db_host, $db_username, $db_password) or die("Could not
connect : " . mysql_error() . "\n");
	mysql_select_db($db_name) or die("Could not select database: " . $db_name . "\n");

		$query =  "SHOW tables";
		$result = mysql_query($query);
		sleep(10);
		$result = mysql_query($query);
?>

the second query bugs out with 
PHP Warning:  mysql_query(): Lost connection to MySQL server during query in
/root/test.php on line 9

If I set the sleep() to a value under 10 seconds everything is fine.


After the wait_timeout has been set in my.cnf everything works as expected.

Comment 1 Tom Lane 2007-04-17 05:33:46 UTC
I can't reproduce this here.  Can't help wondering if it's not a problem with
your networking configuration, rather than mysql per se.

Comment 2 Tom Lane 2008-04-28 16:08:12 UTC
I'm going to close this bug as WORKSFORME.  If you can provide additional information to allow 
reproducing the problem, please reopen.