Database Reference
In-Depth Information
is regularly close to the value of
max_connections
, you might need to bump up the value
of the latter. If there is always a wide gap, you can decrease
max_connections
to reduce
resource allocation.
Is my slave replication server communicating with the master, or has replication stopped?
If
your server is a replication slave, having replication stop is something you want to avoid.
Determining
why
replication stopped may involve some investigation, but finding out
that a problem has occurred is a good first step toward resolving it.
The
SHOW
SLAVE
STATUS
statement helps you here. Alternatively, in MySQL 5.7.2 and
up, the Performance Schema provides a set of tables containing replication configura‐
tion and status information.
Executing
SHOW
SLAVE
STATUS
on the slave provides columns showing the status of the
I/O and SQL threads, and columns containing error information:
mysql>
SHOW SLAVE STATUS\G
…
Slave_IO_Running: Connecting
Slave_SQL_Running: Yes
…
Last_IO_Errno: 2003
Last_IO_Error: error reconnecting to master
'
account
' - retry-time: 60
retries: 7
Last_SQL_Errno: 0
Last_SQL_Error:
…
In this case, the slave is having trouble connecting to the master. If the slave is failing to
execute the statements received from the master,
Slave_SQL_Running
will be
No
and the
SQL error columns will show the error.
For communication problems, the Performance Schema
replication_connec
tion_status
table provides information similar to that just shown:
mysql>
SELECT * FROM performance_schema.replication_connection_status\G
…
SOURCE_UUID: a2813915-ae3d-11e0-a30e-0019d1911a72
THREAD_ID: NULL
SERVICE_STATE: CONNECTING
RECEIVED_TRANSACTION_SET:
LAST_ERROR_NUMBER: 2003
LAST_ERROR_MESSAGE: error reconnecting to master
'
account
' - retry-time: 60
retries: 7
LAST_ERROR_TIMESTAMP: 2014-03-01 09:17:28
For statement execution status, check the
replication_execute_status
table.