Bug #67563 [Com]: mysqli compiled with mysqlnd does not take ipv6 adress as parameter
| From: | bobe at webnaute dot net | Date: | Sat, 18 Apr 2015 14:30:12 +0000 |
| Subject: | Bug #67563 [Com]: mysqli compiled with mysqlnd does not take ipv6 adress as parameter | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-192186@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=67563&edit=1
ID: 67563
Comment by: bobe at webnaute dot net
Reported by: naox at o2 dot pl
Summary: mysqli compiled with mysqlnd does not take ipv6
adress as parameter
Status: Open
Type: Bug
Package: MySQLi related
PHP Version: 5.5.14
Block user comment: N
Private report: N
New Comment:
Here is some tests:
PDO mysql + mysqlnd:
[::1] => ok
::1 => getaddrinfo failed
mysqli_connect() + mysqlnd:
[::1] => ok
::1 => getaddrinfo failed
mysql_connect() + mysqlnd:
[::1] => Failed to parse IPv6 address "[:3306"
::1 => No such file or directory
PDO mysql + libmysqlclient:
[::1] => SQLSTATE[HY000] [2005] Unknown MySQL server host '[::1]'
::1 => ok
mysqli_connect() + libmysqlclient:
[::1] => (HY000/2005): Unknown MySQL server host '[::1]'
::1 => ok
mysql_connect() + libmysqlclient:
[::1] => Unknown MySQL server host '[' (2)
::1 => Can't connect to local MySQL server through socket '1'
Previous Comments:
------------------------------------------------------------------------
[2015-04-18 13:48:50] bobe at webnaute dot net
There is a real problem here because mysqlnd wants the IPv6 address to be enclosed in brackets
(illogical since mysqli_connect() or PDO wants a host, not a url).
But when using libmysqlclient, these extensions wants the IPv6 address NOT to be enclosed in
brackets.
------------------------------------------------------------------------
[2014-07-04 00:17:30] naox at o2 dot pl
Description:
------------
mysqli compiled with mysqlnd does not take ipv6 adress as parameter
<?
mysqli_connect("2a01:43f8:4441:12e7::c8");
?>
# php-compiled-with-mysqlnd a.php
<b>Warning</b>: mysqli_connect(): php_network_getaddresses: getaddrinfo failed: Name or
service not known in <b>/root/a.php</b> on line <b>10</b><br />
# php-compiled-with-libmysql a.php
connects fine
cat /etc/hosts
2a01:43f8:4441:12e7::c8 abc
<?
mysqli_connect("abc");
?>
php-compiled-with-mysqlnd a.php
connects fine
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=67563&edit=1