Bug #66303 Reconsider MySQL 5.6.6 bind-address behaviour when configured as default *
Submitted: 10 Aug 2012 10:55 Modified: 28 Aug 2012 2:35
Reporter: Simon Mudd (OCA) Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Options Severity:S3 (Non-critical)
Version:5.6.6 OS:Any
Assigned to: CPU Architecture:Any
Tags: windmill

[10 Aug 2012 10:55] Simon Mudd
Description:
As mentioned on IRC. It was suggested I make a bug report.

I was recently caught out by a change in the recently released DEV 5.6.6 version which made it refuse to start.  Previously not setting bind-address made it bind impliictly to 0.0.0.0

Now you support ipv6 better and the new default settings is * which allows for ipv4 and ipv6 binding. (That's good.)

Yet on a box I tried to start this on I got the output shown below.

Why? The box is explicitly configured to run ipv4 only, and had ipv6 networking disabled.

How to repeat:
This is not OS specific but as an example on a CentOS 5.6 server I have:

[root@host-01 ~]# cat /etc/sysconfig/network
NETWORKING=yes
NETWORKING_IPV6=no
HOSTNAME=host-01.example.com
GATEWAY=10.0.0.254

And starting the following rpm

-rw-r--r-- 1 root root  85318544 Aug  8 10:21 MySQL-server-5.6.6_m9-1.rhel5.x86_64.rpm

I see:

120809 16:45:16 [Note] Server hostname (bind-address): '*'; port: 3306
120809 16:45:16 [Note]   - '::' resolves to '::';
120809 16:45:16 [ERROR] Failed to create a socket for IPv6 '::': errno: 97.
120809 16:45:16 [ERROR] Can't create IP socket: Address family not supported by protocol
120809 16:45:16 [ERROR] Aborting

Suggested fix:
I really do not want to have to remember AND have to configure an explicit bind-address = 0.0.0.0 in 5.6 to cope with the change.
I'd expect a cleaner way would be to "try" to bind to ipv4 and ipv6 sockets, log the sockets you connect to and warn about those that fail.  If you can't connect to either then stop as now.

That would be the safest and least intrusive behaviour for using the default new parameter of *.

It would also mean the upgrade path from 5.5 to 5.6 requires less explicit configuration changes, and would be simpler.
[10 Aug 2012 15:37] Valeriy Kravchuk
Thank you for the problem report.
[20 Aug 2012 22:17] Mark Callaghan
Just hit the same problem. I am not a network person and was happy to find this bug report. I bet a lot of people are going to waste time on this.
[22 Aug 2012 10:27] Sveta Smirnova
Mark,

thank you for update. Could you please send output of ifconfig in your environment?
[22 Aug 2012 10:48] Alexander Nozdrin
Mark,

what is your OS (where you're facing this problem)?
[22 Aug 2012 13:58] Mark Callaghan
CentOS 5.2

Do you want the output from "ifconfig -a"?
[22 Aug 2012 14:13] Alexander Nozdrin
Yes, please, 'ifconfig -a'.

Thanks!
[22 Aug 2012 14:20] Mark Callaghan
I filed an SR and added the ifconfig output to it
[28 Aug 2012 2:35] Paul DuBois
Noted in 5.6.7, 5.7.0 changelogs.

Starting the server with --bind-address=* is supposed to cause the 
the server to accept TCP/IP connections on all server host IPv6 and
IPv4 interfaces if the server host supports IPv6, or TCP/IP
connections on all IPv4 addresses otherwise. But the server sometimes
did not correctly detect when IPv6 was not supported, and failed to
start.