php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #50439 Can't connect to MySQL database
Submitted: 2009-12-10 14:49 UTC Modified: 2009-12-10 17:44 UTC
From: runar dot orested at gmail dot com Assigned:
Status: Closed Package: MySQL related
PHP Version: 5.3.1 OS: Windows XP
Private report: No CVE-ID: None
 [2009-12-10 14:49 UTC] runar dot orested at gmail dot com
Description:
------------
This version of php (5.3.1, threadsafe, vc6) fails to connect to MySQL server 5.1. Apache is also the latest version (2.2.14).

It hangs (stalls for more of a minute even with shorter scripts timeouts, no dr. watson notification) when using host = 'localhost' (pipes), seems to work with host = '127.0.0.1'. 

Fails with both 'mysql' and mysqli' libraries.

No bugs appear on any logs or on the page, it just hangs for a minute and closes the tread.

Reproduce code:
---------------
$link = MySQL_Connect('localhost', 'root', 'root') or die('cannot connect');
$result = MySQL_Query('show databases', $link) or die('cannot exec');

echo 'Connection ok';
while (false != ($row = MySQL_Fetch_Assoc($result)))
{
print_r($row);
}

Expected result:
----------------
It should eighter work or produce a error, not hang. Maybe a problem with the pipes? As a workaround, how can you force always a network connection?


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-12-10 17:44 UTC] runar dot orested at gmail dot com
Sorry, it seems to be the same as #50263, and previous, except that it 
also happens on windows previous to Vista. Please close. Is there a 
worksaround? IPV6 is disabled and commented out as indicated, but it 
changesnothing.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 30 09:01:29 2024 UTC