1,查看从库状态
Slave_IO_State: Waiting for master to send event
Master_Log_File: mysql-bin.008829 ---当前master的binlog
Read_Master_Log_Pos: 7212816 ---master binlog位置
Relay_Log_File: PVLBI-MySQL2-relay-bin.020559
Relay_Log_Pos: 507636268
Relay_Master_Log_File: mysql-bin.008641 ----当前salve同步到的master的binlog日志
Slave_IO_Running: Yes
Slave_SQL_Running: Yes
Last_Errno: 0
Last_Error:
Exec_Master_Log_Pos: 507636055 -----当前slave执行到的master的binlog 的pos
Relay_Log_Space: 206695473786
Seconds_Behind_Master: 1905909 ---延迟 s 一般是Read_Master_Log_Pos-Exec_Master_Log_Pos
三个重要指标
Relay_Master_Log_File: mysql-bin.008641
Exec_Master_Log_Pos: 507636055
Relay_Log_Space: 4139172581
2,从主库查看数据库在做什么
mysqlbinlog -vvv --base64-output=decode-rows -j 507636055 mysql-bin.008641 | more
或进入数据库查看
show binlog events in 'mysql-bin.008641' from 507636055 limit 10;