[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
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
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
Master_User
Master_Port
Connect_Retry
master-connect-retry
.
Master_Log_File
Read_Master_Log_Pos
Relay_Log_File
Relay_Log_Pos
Relay_Master_Log_File
Slave_IO_Running
Slave_SQL_Running
Replicate_Do_DB, Replicate_Ignore_DB
--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
Last_Error
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
SQL_SLAVE_SKIP_COUNTER
.
Exec_Master_Log_Pos
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
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:
None
if no UNTIL
clause was specified
Master
if the slave is reading until a given position in the master's
binlogs
Relay
if the slave is reading until a given position in its relay logs
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:
Yes
if an SSL connection to the master is allowed
No
if an SSL connection to the master is not allowed
Ignored
if an SSL connection is allowed by the slave server does not
have SSL support enabled
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
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] | [ ? ] |