|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #108 mysql_connect() fails intermitantly
Submitted: 1998-02-26 15:32 UTC Modified: 1998-02-28 06:06 UTC
From: leonatkinson at clearink dot com Assigned:
Status: Closed Package: MySQL related
PHP Version: 3.0 Latest CVS OS: SunOS
Private report: No CVE-ID: None
 [1998-02-26 15:32 UTC] leonatkinson at clearink dot com
PHP3 is running as an apache module, as is PHP2 (2.0.2-dev).
We first saw this behavior upon upgrading after beta 5
came out.  PHP was re-compiled last night from CVS.

Extensions: PHP core, Apache, Basic Functions, PHP_DL,
PHP_dir, PHP_filestat, PHP_file, PHP_head, Sendmail,
Syslog, MySQL, Regular Expressions, gd, Oracle, Crypt,
DMB, browscap, PHP_pack.

MySQL version: 3.21.24-gamma

Example Code:
mysql_connect("", "httpd");

Scripts in both PHP3 and PHP2 fail to connect when executing
the mysql_connect() command.  The error message is:  

Warning: MySQL: Unable to connect to server: Can't connect to MySQL server on (126) in
content/functions/global_settings on line 78

Since this happens in both PHP3 and PHP2, we thought it
might be a problem with MySQL or Apache.  However,
neither of these were upgraded before we noticed this
behavior.  We did upgrade MySQL from a 3.19 version last
night, but the problem is still happening.

If we reload the page, the connect will eventually succeed.
The problem is much worse on PHP3, however, where it may 
take ten retries.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [1998-02-28 06:06 UTC] zeev
Fixed!  Fix options:
1.  Get the latest CVS
2.  Get the patched MySQL file from
3.  Wait for beta 6, due today or tomorrow
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Thu Feb 20 22:01:29 2020 UTC