To configure the slave to start the replication process at the correct point, you need the master's current coordinates within its binary log.

If the master has been running previously without binary logging enabled, the log file name and position values displayed by SHOW MASTER STATUS are empty. In that case, the values that you need to use later when specifying the slave's log file and position are the empty string ('') and 4.

If the master has been binary logging previously, use the SHOW MASTER STATUS statement to determine the current binary log file name and position:

mysql> SHOW MASTER STATUS; 

The output will looking similar to the following, and will have two pieces of critical information:

+------------------+----------+--------------+------------------+
| File             | Position | Binlog_Do_DB | Binlog_Ignore_DB |
+------------------+----------+--------------+------------------+
| mysql-bin.000001 |      107 | example      |                  |
+------------------+----------+--------------+------------------+
1 row in set (0.00 sec)

The File column shows the name of the log file and the Position column shows the position within the file. In this example, the binary log file is mysql-bin.000001 and the position is 107. Record these values. You need them later when you are setting up the slave. They represent the replication coordinates at which the slave should begin processing new updates from the master.


  • No labels