#47820 [Opn->Bgs]: mysql_connect("localhost") dooesn't work
ID: 47820
Updated by: pajoye@php.net
Reported By: busia at tiscali dot it
-Status: Open
+Status: Bogus
Bug Type: MySQL related
Operating System: win32 only - Windows Vista
PHP Version: 5.3.0RC1
New Comment:
It is a IPv6 problem, the solution to remove the ::1 from your host
file is the right to fix it. Not sure what did not work in your case but
there is no bug in php here.
Previous Comments:
------------------------------------------------------------------------
[2009-04-07 09:47:07] busia at tiscali dot it
Yes, I rebooted my pc.
------------------------------------------------------------------------
[2009-04-07 09:10:39] jani@php.net
Since this is Windows, did you reboot?
------------------------------------------------------------------------
[2009-04-06 11:04:12] busia at tiscali dot it
I removed the line without results. The problem persist.
------------------------------------------------------------------------
[2009-03-29 01:38:50] kalle@php.net
Try open your hosts file in:
%SystemRoot%\System32\Drivers\etc\hosts
and remove the IPv6 address (::1) or uncomment it, what your looking
for is:
::1 127.0.0.1
Remove that and it should work
------------------------------------------------------------------------
[2009-03-28 11:35:44] busia at tiscali dot it
Description:
------------
After the update from 5.2.9 to 5.3.0RC1 the command
if(!$db = mysql_connect("localhost", "root", "root")) {
die(mysql_error()." ".mysql_errno());
}
cause mysql timeout
if I use, instead:
if(!$db = mysql_connect("127.0.0.1", "root", "root")) {
die(mysql_error()." ".mysql_errno());
}
All works. In php 5.2.9 all worked well.
Mysql Version is 5.0.77 (installed as windows service)
PHP Version is 5.3.0RC1
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=47820&edit=1
Thread (6 messages)