Direct the slave to use the master. Instruct the slave to use the master as the replication
data source, and to use GTID-based auto-positioning ratherthan file-based positioning. You can do
this by executing a CHANGE MASTER TO statement on the slave, using the
MAS T E R_AUTO_POSITION
option to tell the slave that transactions will be identified by GTlDs.
You may also need to supply appropriate values for the master's host name and port number as well as
the user name and passwDrd for a replication user account which can be used by the slave to connect
to the master; if these have already been set prior to Step 1 and no further changes need to be madę,
the corresponding options can safely be omitted from the statement shown here.
mysql>CHANGE MASTER TO •MASTER_HOST = host,
•MAS TE R_PORT = port,
. -MAS TE R_OS ER = u ser,
>MASTER_PASSWORD = p as sir ord,
•MAS TE R_AUTO_POSITION = 1;
Neither the MASTER_LOG_FILE option nor the MAS TE R_LOG_POS option may be used with
MASTER_AUTO_POS ITION set equal to 1. Attempting to do so causes the CHANGE MASTER
TO statement to fail with an error. (If you need to revert from GTID-based replication to
replication based on files and positions, you must use one or both of these options together with
MASTER_AUTO_POSITION = 0 in the CHANGE MASTER TO statement.)
Assuming that the CHANGE MASTER TO statement has succeeded, you can then
start the slave, like
this:
mysql>START SLAVE;