php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #55489 mysql_connect can't connect on ::1
Submitted: 2011-08-23 12:21 UTC Modified: 2013-02-18 00:34 UTC
Votes:2
Avg. Score:2.0 ± 1.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:1 (100.0%)
From: wojtosz at gmail dot com Assigned:
Status: No Feedback Package: MySQL related
PHP Version: 5.3.7 OS: PLD Linux x86_64
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: wojtosz at gmail dot com
New email:
PHP Version: OS:

 

 [2011-08-23 12:21 UTC] wojtosz at gmail dot com
Description:
------------
mysql_connect can't connect on ::1

Test script:
---------------
$ cat ./x.php 
<?php
mysql_connect('::1', 'mysql', 'SECPASS') or die(mysql_error());
?>

$ php -f ./x.php
PHP Warning:  mysql_connect(): Can't connect to local MySQL server through socket '1' (2) in /home/users/wojtosz/x.php on line 2

Warning: mysql_connect(): Can't connect to local MySQL server through socket '1' (2) in /home/users/wojtosz/x.php on line 2
Can't connect to local MySQL server through socket '1' (2)

Expected result:
----------------
proper mysql server handler.

Actual result:
--------------
PHP Warning:  mysql_connect(): Can't connect to local MySQL server through socket '1' (2) in /home/users/wojtosz/x.php on line 2

Warning: mysql_connect(): Can't connect to local MySQL server through socket '1' (2) in /home/users/wojtosz/x.php on line 2
Can't connect to local MySQL server through socket '1' (2)

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-08-25 16:19 UTC] johannes@php.net
Are you using libmysql or myslqnd? (check "Client Library version" in phpinfo's MySQL boxes) And which MySQL server? MySQL didn't support IPv6 until version 5.5.
 [2011-08-25 16:19 UTC] johannes@php.net
-Status: Open +Status: Feedback
 [2011-09-05 13:10 UTC] wojtosz at gmail dot com
Client Library version: 5.5.13
libmysql is in use.
I'm using MySQL 5.5.13.
 [2013-02-18 00:34 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.
 [2013-02-18 07:51 UTC] wojtosz at gmail dot com
I'm using libmysql (checked by strace: /usr/lib64/libmysqlclient.so.18.0.0)

In MySQL 5.5.28 the problem is still present.

# netstat -nlp | grep                                                          
tcp  0  0 ::1:3306  :::*   LISTEN   5988/mysqld
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Mon Dec 06 06:03:37 2021 UTC