content_image/691973.jpg
option. When binary logging is enabled, the log_bin  system variable, which shows the status of binary logging on the server, is set to ON. 

To disable binary logging, you can specify the --skip-log-bin  or --disable-log-bin  option at startup. If either of these options is specified and --log-bin  is also specified, the option specified later takes precedence. When binary logging is disabled, the log_bin  system variable is set to OFF. 

When GTIDs are in use on the server, if you disable binary logging when restarting the server after an abnormal shutdown, some GTIDs are likely to be lost, causing replication to fail. In a normal shutdown, the set of GTIDs from the current binary log file is saved in the mysql.gtid_executed  table. Following an abnormal shutdown where this did not happen, during recovery the GTIDs are added to the table from the binary log file, provided that binary logging is still enabled. If binary logging is disabled for the server restart, the server cannot access the binary log file to recover the GTIDs, so replication cannot be started. Binary logging can be disabled safely after a normal shutdown. 

The --log-slave-updates  and --slave-preserve-commit-order  options require binary logging. If you disable binary logging, either omit these options, or specify --log-slave- updates=OFF  and --skip-slave-preserve-commit-order . MySQL disables these options by default when --skip-log-bin  or --disable-log-bin  is specified. If you specify --log-slave- updates  or --slave-preserve-commit-order  together with --skip-log-bin  or --disable- log-bin , a warning or error message is issued. 

In MySQL 5.7, a server ID had to be specified when binary logging was enabled, or the server would not start. In MySQL 8.0, the server_id  system variable is set to 1 by default. The server can now be started with this default server ID when binary logging is enabled, but an informational message is issued if you do not specify a server ID explicitly by setting the server_id  system variable. For servers that are used in a replication topology, you must specify a unique nonzero server ID for each server. 

For information on the format and management of the binary log, see Section 5.4.4, “The Binary Log” . 

• --log-bin-index[= file_name ] 

<img src='content_image/691973.jpg'>

The name for the binary log index file, which contains the names of the binary log files. By default, it has the same location and base name as the value specified for the binary log files using the --log-bin option, plus the extension .index . If you do not specify --log-bin , the default binary log index file name is binlog.index . If you specify --log-bin  option with no string or an empty string, the default binary log index file name is host_name -bin.index , using the name of the host machine. 

For information on the format and management of the binary log, see Section 5.4.4, “The Binary Log” . 

Statement selection options.  The options in the following list affect which statements are written to the binary log, and thus sent by a replication source server to its replicas. There are also options for replicas that control which statements received from the source should be executed or ignored. For details, see Section 17.1.6.3, “Replica Server Options and Variables” . 

• --binlog-do-db= db_name 

