|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #47820 mysql_connect("localhost") dooesn't work
Submitted: 2009-03-28 11:35 UTC Modified: 2009-04-07 09:59 UTC
From: busia at tiscali dot it Assigned:
Status: Not a bug Package: MySQL related
PHP Version: 5.3.0RC1 OS: win32 only - Windows Vista
Private report: No CVE-ID: None
 [2009-03-28 11:35 UTC] busia at tiscali dot it
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("", "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


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2009-03-29 01:38 UTC]
Try open your hosts file in:

and remove the IPv6 address (::1) or uncomment it, what your looking for is:

Remove that and it should work
 [2009-04-06 11:04 UTC] busia at tiscali dot it
I removed the line without results. The problem persist.
 [2009-04-07 09:10 UTC]
Since this is Windows, did you reboot?
 [2009-04-07 09:47 UTC] busia at tiscali dot it
Yes, I rebooted my pc.
 [2009-04-07 09:59 UTC]
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.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Jun 18 19:01:32 2024 UTC