Bug #14979 request for more than just one bind-address
Submitted: 16 Nov 2005 12:40 Modified: 15 Apr 2006 1:49
Reporter: Nils Goroll Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: C API (client library) Severity:S4 (Feature request)
Version:4.1, 5.0 OS:Any (*)
Assigned to: CPU Architecture:Any

[16 Nov 2005 12:40] Nils Goroll
Description:
Currently, mysql seems to support only exactly one IP address to bind to
(besides bindung to IN_ADDR_ANY = all addresses).

This is a disadvantage in HA Cluster configurations, where a cluster
framework stops/starts stand-alone mysql instances (non-NDB) on
physical servers within a cluster.

Within such frameworks, you don't want to bind to IN_ADDR_ANY
but rather to specific IP adresses (Sun speak: locical hostname addresses)
in order to allow the cluster framework to switch two instances of
an application onto the same cluster node (with the same (standard)
port number).

This is currently possible with mysql, but only for exacly one IP address
per mysql instance.

In situations where you need more than one IP address for an HA
instance, you either have to bind to IN_ADDR_ANY and somehow
make sure that no two mysql instances will run on any cluster node
at the same time, or find other means by which to provide the second
address (tcp forwarder, NAT on a firewall - whatever).

Both solutions are not ideal, so this feature request is for a configuration
option allowing more than one IP address to be specified.

How to repeat:
try to bind to more than one address:

(yes, i did ifconfig lo0 addif 127.0.0.2 before)

phys-webCv2-1:~# grep bind-addr /etc/my.cnf
bind-address=127.0.0.1
bind-address=127.0.0.2
phys-webCv2-1:~# grep port /etc/my.cnf
port=33307

phys-webCv2-1:~# pfiles $(pgrep mysqld)
2171:   /local/rg-mysqltest/mysql/mysql-standard-4.1.14-pc-solaris2.10-x86_64/
  Current rlimit: 40970 file descriptors
[...]
   3: S_IFSOCK mode:0666 dev:276,0 ino:18926 uid:0 gid:0 size:0
      O_RDWR
        SOCK_STREAM
        SO_REUSEADDR,SO_SNDBUF(49152),SO_RCVBUF(49152)
        sockname: AF_INET 127.0.0.2  port: 33307
   4: S_IFDOOR mode:0444 dev:279,0 ino:63 uid:0 gid:0 size:0
      O_RDONLY|O_LARGEFILE FD_CLOEXEC  door to nscd[144]
      /var/run/name_service_door
   5: S_IFSOCK mode:0666 dev:276,0 ino:6646 uid:0 gid:0 size:0
      O_RDWR
        SOCK_STREAM
        SO_REUSEADDR,SO_SNDBUF(16384),SO_RCVBUF(5120)
        sockname: AF_UNIX /tmp/webC-mysqltest.sock
[...]
phys-webCv2-1:~# telnet 127.0.0.2 33307
Trying 127.0.0.2...
Connected to 127.0.0.2.
Escape character is '^]'.
A
4.1.14-standard-log[...]

phys-webCv2-1:~# telnet 127.0.0.1 33307
Trying 127.0.0.1...
telnet: Unable to connect to remote host: Connection refused
[11 Oct 2006 13:10] Valeriy Kravchuk
Bug #23149 was marked as a duplicate of this one.
[25 Nov 2008 10:57] Axel Schwenke
Preferrably this should be a dynamic variable to allow changing bindings while the MySQL server is online.
[10 Jan 2014 10:13] Florian Roscher
This seems to be true for newer versions, too. At least if binding i.e. to two distinct IPv4 addresses is wanted.

If I read http://dev.mysql.com/doc/refman/5.6/en/server-options.html#option_mysqld_bind-address corrently, up to 5.6 at least.

It looks like I cannot update the field 'Version', so I leave this as a comment.

Regards
Florian
[17 Jun 2019 14:21] John Ericson
This seems to also be relevant to version 5.7.26.