Syntax
------

SHOW SLAVE ["connection_name"] STATUS [FOR CHANNEL "connection_name"]
SHOW REPLICA ["connection_name"] STATUS -- From MariaDB 10.5.1

or

SHOW ALL SLAVES STATUS
SHOW ALL REPLICAS STATUS -- From MariaDB 10.5.1

Description
-----------

This statement is to be run on a replica and provides status information on
essential parameters of the replica threads.

This statement requires the SUPER privilege, the REPLICATION_CLIENT privilege,
or, from MariaDB 10.5.2, the REPLICATION SLAVE ADMIN privilege, or, from
MariaDB 10.5.9, the REPLICA MONITOR privilege.

Multi-Source
------------

The ALL and "connection_name" options allow you to connect to many primaries
at the same time.

ALL SLAVES (or ALL REPLICAS from MariaDB 10.5.1) gives you a list of all
connections to the primary nodes.

The rows will be sorted according to Connection_name.

If you specify a connection_name, you only get the information about that
connection. If connection_name is not used, then the name set by
default_master_connection is used. If the connection name doesn't exist you
will get an error: There is no master connection for 'xxx'.

MariaDB starting with 10.7.0
----------------------------
The FOR CHANNEL keyword was added for MySQL compatibility. This is identical
as using the channel_name directly after SHOW SLAVE.

Column Descriptions
-------------------

+---------------+---------------------------------------+-------------------+
| Name          | Description                           | Added             |
+---------------+---------------------------------------+-------------------+
| Connection_na | Name of the primary connection.       |                   |
| e             | Returned with SHOW ALL SLAVES STATUS  |                   |
|               | (or SHOW ALL REPLICAS STATUS from     |                   |
|               | MariaDB 10.5.1) only.                 |                   |
+---------------+---------------------------------------+-------------------+
| Slave_SQL_Sta | State of SQL thread. Returned with    |                   |
| e             | SHOW ALL SLAVES STATUS (or SHOW ALL   |                   |
|               | REPLICAS STATUS from MariaDB 10.5.1)  |                   |
|               | only. See Slave SQL Thread States.    |                   |
+---------------+---------------------------------------+-------------------+
| Slave_IO_Stat | State of I/O thread. See Slave I/O    |                   |
|               | Thread States.                        |                   |
+---------------+---------------------------------------+-------------------+
| Master_host   | Master host that the replica is       |                   |
|               | connected to.                         |                   |
+---------------+---------------------------------------+-------------------+
| Master_user   | Account user name being used to       |                   |
|               | connect to the primary.               |                   |
+---------------+---------------------------------------+-------------------+
| Master_port   | The port being used to connect to     |                   |
|               | the primary.                          |                   |
+---------------+---------------------------------------+-------------------+
| Connect_Retry | Time in seconds between retries to    |                   |
|               | connect. The default is 60. The       |                   |
|               | CHANGE MASTER TO statement can set    |                   |
|               | this. The master-retry-count option   |                   |
|               | determines the maximum number of      |                   |
|               | reconnection attempts.                |                   |
+---------------+---------------------------------------+-------------------+
| Master_Log_Fi | Name of the primary binary log file   |                   |
| e             | that the I/O thread is currently      |                   |
|               | reading from.                         |                   |
+---------------+---------------------------------------+-------------------+
| Read_Master_L | Position up to which the I/O thread   |                   |
| g_Pos         | has read in the current primary       |                   |
|               | binary log file.                      |                   |
+---------------+---------------------------------------+-------------------+
| Relay_Log_Fil | Name of the relay log file that the   |                   |
|               | SQL thread is currently processing.   |                   |
+---------------+---------------------------------------+-------------------+
| Relay_Log_Pos | Position up to which the SQL thread   |                   |
|               | has finished processing in the        |                   |
|               | current relay log file.               |                   |
+---------------+---------------------------------------+-------------------+
| Relay_Master_ | Name of the primary binary log file   |                   |
| og_File       | that contains the most recent event   |                   |
|               | executed by the SQL thread.           |                   |
+---------------+---------------------------------------+-------------------+
| Slave_IO_Runn | Whether the replica I/O thread is     |                   |