Bug #79146 Can't connect to MySQL server on IPV6
Submitted: 6 Nov 2015 2:45 Modified: 26 Nov 2015 12:48
Reporter: Leon Panokarren Email Updates:
Status: Not a Bug Impact on me:
None 
Category:Connector / ODBC Severity:S2 (Serious)
Version: OS:CentOS (3.2.55-106)
Assigned to: CPU Architecture:Any
Tags: ipv6

[6 Nov 2015 2:45] Leon Panokarren
Description:
When trying to connect to a MySQL server that has a V6 listener from a client machine that only has a V6 interface, the connection fails with the error -

[S1000][unixODBC][MySQL][ODBC 5.1 Driver]Can't connect to MySQL server on "MYSQL Server name"

I am able to connect well from another client machine that has V4 interface as well. In the strace, I notice, the V4 address is resolved by the driver after it gets a V6 answer for the MySQL host. 

Does the MySQL 5.1 ODBC not support V6? 

How to repeat:
isql "odbc.ini header" "user name" "password"

[S1000][unixODBC][MySQL][ODBC 5.1 Driver]Can't connect to MySQL server on "MYSQL Server name"
[11 Nov 2015 19:16] Leon Panokarren
Just meant to check if you had a breakthrough?
[16 Nov 2015 19:17] Leon Panokarren
This is keeping us from continuing the use of MySQL since from an infrastructure standpoint we are moving to IPv6 internally. MySQL as a database solution is working just fine for us - isn't there a solution to this problem? I confirmed from the strace for the isql that the client/odbc connects to DNS, and then uses an IPv4 address to connect on a pure IPv6 machine. Is there a way to confirm what is the source of the problem here - 

1. that the DNS server response has only a V4 address? OR
2. the mysql client is 'preferring' the V4 address? OR
3. something else
[16 Nov 2015 19:51] Leon Panokarren
What is the specific call the MySQL 5.1 driver makes to the DNS server?
[16 Nov 2015 20:00] Leon Panokarren
Just wanted to confirm here - with a tcpdump I see that the DNS query issued by the driver asked EXCLUSIVELY for a Type A record, instead of including a Type AAAA record predicate.

How can this be resolved? Are there flags we can set?
[16 Nov 2015 20:49] Leon Panokarren
Ok, I was able to resolve this by moving to 5.3 driver. Was this supported with 5.1?
[26 Nov 2015 12:48] Chiranjeevi Battula
Hello Leon Panokarren,

Thank you for the bug report.
I'm glad that you resolved your problem by moving to 5.3 driver and it doesn't support IPv6 in 5.1 version.

Thanks,
Chiranjeevi.