| MASTER_SSL = {0|1} | MASTER_SSL_CA = ’ ca_file_name ’ | MASTER_SSL_CAPATH = ’ ca_directory_name ’ | MASTER_SSL_CERT = ’ cert_file_name ’ | MASTER_SSL_CRL = ’ crl_file_name ’ | MASTER_SSL_CRLPATH = ’ crl_directory_name ’ | MASTER_SSL_KEY = ’ key_file_name ’ | MASTER_SSL_CIPHER = ’ cipher_list ’ | MASTER_SSL_VERIFY_SERVER_CERT = {0|1} | MASTER_TLS_VERSION = ’ protocol_list ’ | MASTER_TLS_CIPHERSUITES = ’ ciphersuite_list ’ | MASTER_PUBLIC_KEY_PATH = ’ key_file_name ’ | GET_MASTER_PUBLIC_KEY = {0|1} | NETWORK_NAMESPACE = ’ namespace ’ | IGNORE_SERVER_IDS = ( server_id_list ) } channel_option : FOR CHANNEL channel server_id_list : [ server_id  [, server_id ] ... ] 

CHANGE MASTER TO  changes the parameters that the replica server uses for connecting to the source and for reading data from the source. It also updates the contents of the replication metadata repositories (see Section 17.2.4, “Relay Log and Replication Metadata Repositories” ). From MySQL 8.0.23, use CHANGE REPLICATION SOURCE TO  in place of CHANGE MASTER TO , which is deprecated from that release. In releases before MySQL 8.0.23, use CHANGE MASTER TO . 

You can issue CHANGE MASTER TO  statements on a running replica without first stopping it, depending on the states of the replication SQL thread and replication I/O thread. The rules governing such use are provided later in this section. CHANGE MASTER TO  requires the REPLICATION_SLAVE_ADMIN  privilege (or the deprecated SUPER  privilege). 

When using a multithreaded replica (in other words slave_parallel_workers  is greater than 0), stopping the replica can cause “gaps”  in the sequence of transactions that have been executed from the relay log, regardless of whether the replica was stopped intentionally or otherwise. When such gaps exist, issuing CHANGE MASTER TO  fails. The solution in this situation is to issue START REPLICA | SLAVE UNTIL SQL_AFTER_MTS_GAPS  which ensures that the gaps are closed. 

The optional FOR CHANNEL channel  clause enables you to name which replication channel the statement applies to. Providing a FOR CHANNEL channel  clause applies the CHANGE MASTER TO statement to a specific replication channel, and is used to add a new channel or modify an existing channel. For example, to add a new channel called channel2 : 

CHANGE MASTER TO MASTER_HOST=host1, MASTER_PORT=3002 FOR CHANNEL ’channel2’ 

If no clause is named and no extra channels exist, the statement applies to the default channel. 

When using multiple replication channels, if a CHANGE MASTER TO  statement does not name a channel using a FOR CHANNEL channel  clause, an error occurs. See Section 17.2.2, “Replication Channels”  for more information. 

Values used for MASTER_HOST  and other CHANGE MASTER TO  options are checked for linefeed ( 
 or 0x0A ) characters. The presence of such characters in these values causes the statement to fail with ER_MASTER_INFO . 

Invoking CHANGE MASTER TO  causes the previous values for MASTER_HOST , MASTER_PORT , MASTER_LOG_FILE , and MASTER_LOG_POS  to be written to the error log, along with other information about the replica’s state prior to execution. 

