問題描述
在主文件日誌中獲得最後位置(MySQL 複製)? (Getting last position in master‑file‑log (MySQL replication)?)
How could I retrieve last position in master's log‑bin? For example when I write CHANGE MASTER TO...
I can't see master's status so I don't know the master‑file‑pos...
參考解法
方法 1:
On your master machine in mysql type:
SHOW MASTER STATUS;
mysql> SHOW MASTER STATUS;
+‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑+‑‑‑‑‑‑‑‑‑‑+‑‑‑‑‑‑‑‑‑‑‑‑‑‑+‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑+
| File | Position | Binlog_Do_DB | Binlog_Ignore_DB |
+‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑+‑‑‑‑‑‑‑‑‑‑+‑‑‑‑‑‑‑‑‑‑‑‑‑‑+‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑+
| mysql‑bin.003 | 73 | test | manual,mysql |
+‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑+‑‑‑‑‑‑‑‑‑‑+‑‑‑‑‑‑‑‑‑‑‑‑‑‑+‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑+
方法 2:
Well, I am not sure what you exactly want to achive, but do a SHOW SLAVE STATUS;
and look there for Exec_Master_Log_Pos, this will give you the last position until which the slave SQL thread has executed the events from the masters binary log.
For additional information refer to the docs you can find here: SHOW SLAVE STATUS Syntax
(by Dedyshka、metalfight ‑ user868766、Flo Doe)