MySQL Reference Manual for version 4.0.18.

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

13.6.2.7 SHOW SLAVE STATUS

 
SHOW SLAVE STATUS

Provides status information on essential parameters of the slave threads. If you issue this statement using the mysql client, you can use a \G statement terminator rather than semicolon to get a more readable vertical layout:

 
mysql> SHOW SLAVE STATUS\G
*************************** 1. row ***************************
       Slave_IO_State: Waiting for master to send event
          Master_Host: localhost
          Master_User: root
          Master_Port: 3306
        Connect_Retry: 3
      Master_Log_File: gbichot-bin.005
  Read_Master_Log_Pos: 79
       Relay_Log_File: gbichot-relay-bin.005
        Relay_Log_Pos: 548
Relay_Master_Log_File: gbichot-bin.005
     Slave_IO_Running: Yes
    Slave_SQL_Running: Yes
      Replicate_Do_DB:
  Replicate_Ignore_DB:
           Last_Errno: 0
           Last_Error:
         Skip_Counter: 0
  Exec_Master_Log_Pos: 79
      Relay_Log_Space: 552
      Until_Condition: None
       Until_Log_File:
        Until_Log_Pos: 0
   Master_SSL_Allowed: No
   Master_SSL_CA_File:
   Master_SSL_CA_Path:
      Master_SSL_Cert:
    Master_SSL_Cipher:
       Master_SSL_Key:
Seconds_Behind_Master: 8

Depending on your version of MySQL, you may not see all the fields just shown. In particular, several fields are present only as of MySQL 4.1.1.

The fields displayed by SHOW SLAVE STATUS have the following meanings:

Slave_IO_State
A copy of the State column of the output of SHOW PROCESSLIST for the slave I/O thread; will tell you if this thread is trying to connect to the master, waiting for events from the master, reconnecting to the master, etc. Possible states are listed in 6.3 Replication Implementation Details. Looking at this column is necessary because, for example, the thread can be running but unsuccessfully trying to connect to the master: only this column will make you aware of the connection problem. On the opposite, the state of the SQL thread is not copied, because things are simpler for this thread: if it's running, there is no problem; if it's not, you will find the error in the Last_Error column (described below).

This field is present beginning with MySQL 4.1.1.

Master_Host
The current master host.

Master_User
The current user used to connect to the master.

Master_Port
The current master port.

Connect_Retry
The current value of master-connect-retry.

Master_Log_File
The name of the master's binlog file from which the I/O thread is currently reading.

Read_Master_Log_Pos
The position which the I/O thread has read up to in this master's binlog.

Relay_Log_File
The name of the relay log file from which the SQL thread is currently reading and executing.

Relay_Log_Pos
The position which the SQL thread has read and executed up to in this relay log.

Relay_Master_Log_File
The name of the master's binlog file that contains the last event executed by the SQL thread.

Slave_IO_Running
Tells whether or not the I/O thread is started.

Slave_SQL_Running
Tells whether or not the SQL thread is started.

Replicate_Do_DB, Replicate_Ignore_DB
The lists of the databases that were specified with the --replicate-do-db and --replicate-ignore-db options, if any

Replicate_Do_Table, Replicate_Ignore_Table, Replicate_Wild_Do_Table, Replicate_Wild_Ignore_Table

The lists of tables that were specified with the --replicate-do-table, --replicate-ignore-table, --replicate-wild-do-table, and --replicate-wild-ignore_table options, if any

These fields are present beginning with MySQL 4.1.1.

Last_Errno
The error number returned by the most recently executed query. A value of 0 means "no error".

Last_Error
The error message returned by the most recently executed query. For example:

 
Last_Errno: 1051
Last_Error: error 'Unknown table 'z'' on query 'drop table z'

The message indicates that the table z existed on the master and was dropped there, but it did not exist on the slave, so DROP TABLE failed on the slave. (This might occur if you forgot to copy the table to the slave when setting up replication.)

The empty string means "no error". If the Last_Error value is not empty, it will also appear as a message in the slave's error log.

Skip_Counter
The last used value for SQL_SLAVE_SKIP_COUNTER.

Exec_Master_Log_Pos
The position in the master's binlog (Relay_Master_Log_File) of the last event executed by the SQL thread. ((Relay_Master_Log_File,Exec_Master_Log_Pos) in the master's binlog corresponds to (Relay_Log_File,Relay_Log_Pos) in the relay log).

Relay_Log_Space
The total combined size of all existing relay logs.

Until_Condition, Until_Log_File, Until_Log_Pos

The values specified in the UNTIL clause of the START SLAVE statement.

Until_Condition has these values:

Until_Log_File and Until_Log_Pos indicate the log filename and position values that define the point at which the SQL thread will stop executing.

These fields are present beginning with MySQL 4.1.1.

Master_SSL_Allowed, Master_SSL_CA_File, Master_SSL_CA_Path, Master_SSL_Cert, Master_SSL_Cipher, Master_SSL_Key

These fields show the The SSL parameters used by the slave to connect to the master, if any.

Master_SSL_Allowed has these values:

The values of the other fields correspond to the values of the --master-ca, --master-capath, --master-cert, --master-cipher, and --master-key options.

These fields are present beginning with MySQL 4.1.1.

Seconds_Behind_Master
The number of seconds that have elapsed since the timestamp of the last master's event executed by the slave SQL thread. Will be NULL when no event has been executed yet, or after CHANGE MASTER and RESET SLAVE. This column can be used to know how "late" your slave is. It will work even though your master and slave don't have identical clocks.

This field is present beginning with MySQL 4.1.1.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

This document was generated by rdg (Feb 25 2004) using texi2html