This MySQL statement displays a list of slave servers for the master server.
hits past month: 8 ; last updated: may 4, 2009 - 2:34am ; parent: MySQL ReplicationSHOW SLAVE HOSTS
This MySQL statement displays a list of replication slave servers for the master server running replication. Slaves must be started with the --report-host=slave option in order to be visible.
SHOW SLAVE HOSTS; +------------+-----------+------+-----------+ | Server_id | Host | Port | Master_id | +------------+-----------+------+-----------+ | 2 | slave2 | 3306 | 1 | | 3 | slave3 | 3306 | 1 | +------------+-----------+------+-----------+
In the results there are four values for each slave:
The server identification number for the replication slave server, which is set by the --server-id option (preferably in the slave's options file).
The host name of the replication slave server, which is set by the --report-host option on the slave.
The port on which the replication slave is listening for replication. This defaults to 3306, but can be set with the MySQL statement, CHANGE MASTER TO.
The server identification number of the master running replication. It's set on the master with --server-id and conversely on the slave with the MySQL statement, CHANGE MASTER TO.