SET sql_log_bin = {OFF|ON} 

The sql_log_bin  variable controls whether logging to the binary log is enabled for the current session (assuming that the binary log itself is enabled). The default value is ON . To disable or enable binary logging for the current session, set the session sql_log_bin  variable to OFF  or ON . 

Set this variable to OFF  for a session to temporarily disable binary logging while making changes to the source that you do not want replicated to the replica. 

Setting the session value of this system variable is a restricted operation. The session user must have privileges sufficient to set restricted session variables. See Section 5.1.9.1, “System Variable Privileges” . 

It is not possible to set the session value of sql_log_bin  within a transaction or subquery. 

Setting this variable to OFF  prevents new GTIDs from being assigned to transactions in the binary log . If you are using GTIDs for replication, this means that even when binary logging is later enabled again, the GTIDs written into the log from this point do not account for any transactions that occurred in the meantime, so in effect those transactions are lost. 

mysqldump  adds a SET @@SESSION.sql_log_bin=0  statement to a dump file from a server where GTIDs are in use, which disables binary logging while the dump file is being reloaded. The statement prevents new GTIDs from being generated and assigned to the transactions in the dump file as they are executed, so that the original GTIDs for the transactions are used. 

## 13.4.2 SQL Statements for Controlling Replica Servers 

This section discusses statements for managing replica servers. Section 13.4.1, “SQL Statements for Controlling Source Servers” , discusses statements for managing source servers. 

In addition to the statements described here, SHOW REPLICA | SLAVE STATUS  and SHOW RELAYLOG EVENTS  are also used with replicas. For information about these statements, see Section 13.7.7.35, “SHOW REPLICA | SLAVE STATUS Statement” , and Section 13.7.7.32, “SHOW RELAYLOG EVENTS Statement” . 

## 13.4.2.1 CHANGE MASTER TO Statement 

CHANGE MASTER TO option  [, option ] ... [ channel_option  ] option : { MASTER_BIND = ’ interface_name ’ | MASTER_HOST = ’ host_name ’ | MASTER_USER = ’ user_name ’ | MASTER_PASSWORD = ’ password ’ | MASTER_PORT = port_num | PRIVILEGE_CHECKS_USER = {’ account ’ | NULL} | REQUIRE_ROW_FORMAT = {0|1} | REQUIRE_TABLE_PRIMARY_KEY_CHECK = {STREAM | ON | OFF} | ASSIGN_GTIDS_TO_ANONYMOUS_TRANSACTIONS = {OFF | LOCAL | uuid } | MASTER_LOG_FILE = ’ source_log_name ’ | MASTER_LOG_POS = source_log_pos | MASTER_AUTO_POSITION = {0|1} | RELAY_LOG_FILE = ’ relay_log_name ’ | RELAY_LOG_POS = relay_log_pos | MASTER_HEARTBEAT_PERIOD = interval | MASTER_CONNECT_RETRY = interval | MASTER_RETRY_COUNT = count | SOURCE_CONNECTION_AUTO_FAILOVER = {0|1} | MASTER_DELAY = interval | MASTER_COMPRESSION_ALGORITHMS = ’ value ’ | MASTER_ZSTD_COMPRESSION_LEVEL = level 

