Bug 61582 - The DBD can't connect to the MySQL server via IPv6
Summary: The DBD can't connect to the MySQL server via IPv6
Status: NEW
Alias: None
Product: APR
Classification: Unclassified
Component: APR (show other bugs)
Version: 1.6.2
Hardware: PC Linux
: P2 normal (vote)
Target Milestone: ---
Assignee: Apache Portable Runtime bugs mailinglist
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-10-02 13:05 UTC by Ottó Király
Modified: 2017-10-05 10:01 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ottó Király 2017-10-02 13:05:47 UTC
Hi,

I tried to authenticate a site with DBD and the remote MySQL database is not reachable via IPv6 (the IPv4 connection working without any problem). The Apache (httpd-2.2.15-59.el6.x86_64) is running on a RH6 system, and from the APR, APR-Util and APR-Util-MySQL has been installed the latest version.

[root@TesztRH6 apr-1.6.2]# rpm -qa | grep -i apr | sort
apr-1.6.2-1.x86_64
apr-devel-1.6.2-1.x86_64
apr-util-1.6.0-1.x86_64
apr-util-ldap-1.6.0-1.x86_64
apr-util-mysql-1.6.0-1.x86_64

The IPv6 theoretically enabled, because when I created the rpm from the tar.bz2, I seen this in the compiling log: 

Checking for IPv6 Networking support...
checking for library containing getaddrinfo... none required
checking for library containing gai_strerror... none required
checking for library containing getnameinfo... none required
checking for gai_strerror... yes
checking for working getaddrinfo... yes
checking for negative error codes for getaddrinfo... yes
checking for working getnameinfo... yes
checking for sockaddr_in6... yes
checking for sockaddr_storage... yes
checking for sockaddr_un... yes
checking for working AI_ADDRCONFIG... yes
checking if APR supports IPv6... yes

The params in /etc/httpd/conf.d/dbd_mysql.conf file: 
DBDParams host=2002:5cf9:e053:...,port=3306,dbname=database,user=root,pass=password
I tried to connect the host with [ ], but nothing changed.

The /var/log/httpd/error_log file:
[Mon Oct 02 11:55:06 2017] [notice] Apache/2.2.15 (Unix) DAV/2 PHP/5.3.3 configured -- resuming normal operations
[Mon Oct 02 11:55:06 2017] [error] (20014)Internal error: DBD: Can't connect to mysql
[Mon Oct 02 11:55:06 2017] [error] (20014)Internal error: DBD: failed to initialise
[Mon Oct 02 11:55:06 2017] [crit] (20014)Internal error: DBD: child init failed!

When I tried to connect to the MySQL DB server with mysql command and with IPv6 and connection working properly.

[root@TesztRH6 apr-1.6.2]# mysql -V
mysql  Ver 14.14 Distrib 5.7.19, for Linux (x86_64) using  EditLine wrapper

[root@TesztRH6 apr-1.6.2]# mysql --host=2002:5cf9:e053:... -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 116
Server version: 5.5.5-10.1.26-MariaDB MariaDB Server

Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql>

The situation is the same with Apache 2.4 (httpd24-httpd-2.4.6-5.el6) too.

Do you have any idea why not working the IPv6 connection?

Regards,
Ottó
Comment 1 William A. Rowe Jr. 2017-10-04 16:33:22 UTC
That's not a valid hostname, did you try square brackets?
Comment 2 Ottó Király 2017-10-05 10:01:03 UTC
(In reply to William A. Rowe Jr. from comment #1)
> That's not a valid hostname, did you try square brackets?

Yes, I tried with square bracket too, but the message is the same.

[Wed Oct 04 22:11:37 2017] [error] (20014)Internal error (specific information not available): DBD: Can't connect to mysql
[Wed Oct 04 22:11:37 2017] [error] (20014)Internal error (specific information not available): DBD: failed to initialise