MASTER_BIND is an optional clause used inside the MySQL replication statements CHANGE MASTER TO and START SLAVE (or START REPLICA in newer versions). When supplied, the replica (formerly called the slave) binds its network socket to the given local IPv4 or IPv6 address before initiating the TCP connection to the primary (master) server. This is useful on multi-homed hosts that have multiple NICs or IPs and you need to enforce a particular source address for replication traffic, meet firewall rules, or keep replication traffic on a dedicated VLAN.Behavior:- Operates only on the replica side.- Accepts a literal IP address. Host names and interface names are not supported.- If the supplied address is not present on any local interface, the bind fails and replication does not start.- Applies immediately after CHANGE MASTER TO if SQL_THREAD or IO_THREAD is started. Otherwise it takes effect when START SLAVE is executed.- Works for both IPv4 and IPv6 as long as the operating system allows binding to that address.Caveats:- Does not retroactively affect an already open replication connection; you must restart replication threads.- Only one address can be supplied.- Not supported on Windows prior to MySQL 8.0.13.- Ignored on Group Replication channels; only traditional asynchronous or semi-sync channels honor it.
ip_address
(string) - Required literal IPv4 or IPv6 address on the replica host that the replication socket should bind to.#VALUE!
CHANGE MASTER TO, START SLAVE, MASTER_HOST, MASTER_PORT, replication channels, source-address binding
MySQL 5.6
MASTER_BIND tells the replica which local IP address to use when opening the replication socket. This lets you force replication traffic through a specific network interface.
No. Replication works fine without it. Use it only when you need strict control over the replica’s source IP address.
Run SHOW SLAVE STATUS and inspect the value of Master_Host and the operating system’s netstat or ss output. The local address column should show the IP given in MASTER_BIND.
No. The option accepts exactly one address. If you need failover across interfaces you must script a CHANGE MASTER TO with a different MASTER_BIND or use OS-level IP takeover tools.