Bug #12392: mysql_pconnect() and timed-out connections
| From: | carl at thep dot lu dot se dot NOSPAM | Date: | Thu, 26 Jul 2001 09:54:23 +0000 |
| Subject: | Bug #12392: mysql_pconnect() and timed-out connections | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-61043@lists.php.net to get a copy of this message | ||
From: carl@thep.lu.se.NOSPAM
Operating system:
PHP version: 4.0.6
PHP Bug Type: MySQL related
Bug description: mysql_pconnect() and timed-out connections
I'm not 100% sure this isn't a bug in mysql, but here it goes:
I installed mysql 2.23.39, apache and php4.0.6 a few days ago, and
I've had to restart mysql every morning because mysql_pconnect()
fails as the connections have timed out (wait_timeout is set to 8 hours).
First this is logged by mysql (a few times):
010726 6:28:43 Aborted connection 299 to db: 'lumad' user: 'lumad' host:
`localhost' (Got timeout reading communication packets)
Then when I try to pconnect PHP logs this:
[Thu Jul 26 11:23:36 2001] [error] PHP Warning: MySQL: Link to server
lost, unable to reconnect in /export/home/carl/apache/htdocs/db.inc.php on
line 8
And after a few more retries I get this:
[Thu Jul 26 11:31:46 2001] [error] PHP Warning: Can't connect to local
MySQL server through socket '/tmp/mysql.sock' (111) in
/export/home/carl/apache/htdocs/db.inc.php on line 8
At this point /tmp/mysql.sock has disappeared, and to get it to reappear
I have to restart mysql.
I've considered raising wait_timeout to infinity, but then there'd be
problems
if a (non-php) program forgets to call mysql_close(). For now I'll just
switch to mysql_connect().
--
Edit bug report at: http://bugs.php.net/?id=12392&edit=1