<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h4 class="title">
      <a name="replication-options-binary-log">
      </a>
      19.1.6.4 Binary Logging Options and Variables
     </h4>
    </div>
   </div>
  </div>
  <div class="itemizedlist">
   <ul class="itemizedlist" style="list-style-type: disc; ">
    <li class="listitem">
     <p>
      <a class="xref" href="replication-options-binary-log.html#replication-optvars-binlog" title="Startup Options Used with Binary Logging">
       Startup Options Used with Binary Logging
      </a>
     </p>
    </li>
    <li class="listitem">
     <p>
      <a class="xref" href="replication-options-binary-log.html#replication-sysvars-binlog" title="System Variables Used with Binary Logging">
       System Variables Used with Binary Logging
      </a>
     </p>
    </li>
   </ul>
  </div>
  <p>
   You can use the
   <a class="link" href="mysqld.html" title="6.3.1 mysqld — The MySQL Server">
    <span class="command">
     <strong>
      mysqld
     </strong>
    </span>
   </a>
   options and system
      variables that are described in this section to affect the
      operation of the binary log as well as to control which statements
      are written to the binary log. For additional information about
      the binary log, see
   <a class="xref" href="binary-log.html" title="7.4.4 The Binary Log">
    Section 7.4.4, “The Binary Log”
   </a>
   . For additional
      information about using MySQL server options and system variables,
      see
   <a class="xref" href="server-options.html" title="7.1.7 Server Command Options">
    Section 7.1.7, “Server Command Options”
   </a>
   , and
   <a class="xref" href="server-system-variables.html" title="7.1.8 Server System Variables">
    Section 7.1.8, “Server System Variables”
   </a>
   .
  </p>
  <div class="simplesect">
   <div class="titlepage">
    <div>
     <div class="simple">
      <h5 class="title">
       <a name="replication-optvars-binlog">
       </a>
       Startup Options Used with Binary Logging
      </h5>
     </div>
    </div>
   </div>
   <p>
    The following list describes startup options for enabling and
        configuring the binary log. System variables used with binary
        logging are discussed later in this section.
   </p>
   <div class="itemizedlist">
    <ul class="itemizedlist" style="list-style-type: disc; ">
     <li class="listitem">
      <p>
       <a name="option_mysqld_binlog-row-event-max-size">
       </a>
       <a class="link" href="replication-options-binary-log.html#option_mysqld_binlog-row-event-max-size">
        <code class="option">
         --binlog-row-event-max-size=
         <em class="replaceable">
          <code>
           N
          </code>
         </em>
        </code>
       </a>
      </p>
      <a class="indexterm" name="idm46045140972496">
      </a>
      <a class="indexterm" name="idm46045140970992">
      </a>
      <div class="informaltable">
       <table frame="box" rules="all" summary="Properties for binlog-row-event-max-size">
        <colgroup>
         <col style="width: 30%"/>
         <col style="width: 70%"/>
        </colgroup>
        <tbody>
         <tr>
          <th>
           Command-Line Format
          </th>
          <td>
           <code class="literal">
            --binlog-row-event-max-size=#
           </code>
          </td>
         </tr>
         <tr>
          <th>
           System Variable
          </th>
          <td>
           <code class="literal">
            <a class="link" href="replication-options-binary-log.html#sysvar_binlog_row_event_max_size">
             binlog_row_event_max_size
            </a>
           </code>
          </td>
         </tr>
         <tr>
          <th>
           Scope
          </th>
          <td>
           Global
          </td>
         </tr>
         <tr>
          <th>
           Dynamic
          </th>
          <td>
           No
          </td>
         </tr>
         <tr>
          <th>
           <a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
            <code class="literal">
             SET_VAR
            </code>
           </a>
           Hint Applies
          </th>
          <td>
           No
          </td>
         </tr>
         <tr>
          <th>
           Type
          </th>
          <td>
           Integer
          </td>
         </tr>
         <tr>
          <th>
           Default Value
          </th>
          <td>
           <code class="literal">
            8192
           </code>
          </td>
         </tr>
         <tr>
          <th>
           Minimum Value
          </th>
          <td>
           <code class="literal">
            256
           </code>
          </td>
         </tr>
         <tr>
          <th>
           Maximum Value (64-bit platforms)
          </th>
          <td>
           <code class="literal">
            18446744073709551615
           </code>
          </td>
         </tr>
         <tr>
          <th>
           Maximum Value (32-bit platforms)
          </th>
          <td>
           <code class="literal">
            4294967295
           </code>
          </td>
         </tr>
         <tr>
          <th>
           Unit
          </th>
          <td>
           bytes
          </td>
         </tr>
        </tbody>
       </table>
      </div>
      <p>
       When row-based binary logging is used, this setting is a
            soft limit on the maximum size of a row-based binary log
            event, in bytes. Where possible, rows stored in the binary
            log are grouped into events with a size not exceeding the
            value of this setting. If an event cannot be split, the
            maximum size can be exceeded. The value must be (or else
            gets rounded down to) a multiple of 256. The default is 8192
            bytes.
      </p>
     </li>
     <li class="listitem">
      <p>
       <a name="option_mysqld_log-bin">
       </a>
       <a class="link" href="replication-options-binary-log.html#option_mysqld_log-bin">
        <code class="option">
         --log-bin[=
         <em class="replaceable">
          <code>
           base_name
          </code>
         </em>
         ]
        </code>
       </a>
      </p>
      <a class="indexterm" name="idm46045140936496">
      </a>
      <a class="indexterm" name="idm46045140935008">
      </a>
      <div class="informaltable">
       <table frame="box" rules="all" summary="Properties for log-bin">
        <colgroup>
         <col style="width: 30%"/>
         <col style="width: 70%"/>
        </colgroup>
        <tbody>
         <tr>
          <th>
           Command-Line Format
          </th>
          <td>
           <code class="literal">
            --log-bin=file_name
           </code>
          </td>
         </tr>
         <tr>
          <th>
           Type
          </th>
          <td>
           File name
          </td>
         </tr>
        </tbody>
       </table>
      </div>
      <p>
       Specifies the base name to use for binary log files. With
            binary logging enabled, the server logs all statements that
            change data to the binary log, which is used for backup and
            replication. The binary log is a sequence of files with a
            base name and numeric extension. The
       <code class="option">
        --log-bin
       </code>
       option value is the base name for
            the log sequence. The server creates binary log files in
            sequence by adding a numeric suffix to the base name.
      </p>
      <p>
       If you do not supply the
       <code class="option">
        --log-bin
       </code>
       option,
            MySQL uses
       <code class="filename">
        binlog
       </code>
       as the default base
            name for the binary log files. For compatibility with
            earlier releases, if you supply the
       <code class="option">
        --log-bin
       </code>
       option with no string or with an
            empty string, the base name defaults to
       <code class="filename">
        <em class="replaceable">
         <code>
          host_name
         </code>
        </em>
        -bin
       </code>
       ,
            using the name of the host machine.
      </p>
      <p>
       The default location for binary log files is the data
            directory. You can use the
       <code class="option">
        --log-bin
       </code>
       option
            to specify an alternative location, by adding a leading
            absolute path name to the base name to specify a different
            directory. When the server reads an entry from the binary
            log index file, which tracks the binary log files that have
            been used, it checks whether the entry contains a relative
            path. If it does, the relative part of the path is replaced
            with the absolute path set using the
       <code class="option">
        --log-bin
       </code>
       option. An absolute path recorded
            in the binary log index file remains unchanged; in such a
            case, the index file must be edited manually to enable a new
            path or paths to be used. The binary log file base name and
            any specified path are available as the
       <a class="link" href="replication-options-binary-log.html#sysvar_log_bin_basename">
        <code class="literal">
         log_bin_basename
        </code>
       </a>
       system
            variable.
      </p>
      <p>
       In MySQL 8.4, binary logging is enabled by
            default, whether or not you specify the
       <code class="option">
        --log-bin
       </code>
       option. The exception is if you
            use
       <a class="link" href="mysqld.html" title="6.3.1 mysqld — The MySQL Server">
        <span class="command">
         <strong>
          mysqld
         </strong>
        </span>
       </a>
       to initialize the data
            directory manually by invoking it with the
       <code class="option">
        --initialize
       </code>
       or
       <code class="option">
        --initialize-insecure
       </code>
       option, when binary
            logging is disabled by default. It is possible to enable
            binary logging in this case by specifying the
       <code class="option">
        --log-bin
       </code>
       option. When binary logging is
            enabled, the
       <a class="link" href="replication-options-binary-log.html#sysvar_log_bin">
        <code class="literal">
         log_bin
        </code>
       </a>
       system
            variable, which shows the status of binary logging on the
            server, is set to ON.
      </p>
      <p>
       To disable binary logging, you can specify the
       <a class="link" href="replication-options-binary-log.html#option_mysqld_log-bin">
        <code class="option">
         --skip-log-bin
        </code>
       </a>
       or
       <a class="link" href="replication-options-binary-log.html#option_mysqld_log-bin">
        <code class="option">
         --disable-log-bin
        </code>
       </a>
       option at startup. If either of these options is specified
            and
       <code class="option">
        --log-bin
       </code>
       is also specified, the option
            specified later takes precedence. When binary logging is
            disabled, the
       <a class="link" href="replication-options-binary-log.html#sysvar_log_bin">
        <code class="literal">
         log_bin
        </code>
       </a>
       system variable is set to OFF.
      </p>
      <p>
       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
       <code class="literal">
        mysql.gtid_executed
       </code>
       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.
      </p>
      <p>
       The
       <a class="link" href="replication-options-binary-log.html#sysvar_log_replica_updates">
        <code class="option">
         --log-replica-updates
        </code>
       </a>
       and
       <a class="link" href="replication-options-replica.html#sysvar_replica_preserve_commit_order">
        <code class="option">
         --replica-preserve-commit-order
        </code>
       </a>
       options require binary logging. If you disable binary
            logging, either omit these options, or specify
       <code class="option">
        --log-replica-updates=OFF
       </code>
       and
       <code class="option">
        --skip-replica-preserve-commit-order
       </code>
       . MySQL
            disables these options by default when
       <a class="link" href="replication-options-binary-log.html#option_mysqld_log-bin">
        <code class="option">
         --skip-log-bin
        </code>
       </a>
       or
       <a class="link" href="replication-options-binary-log.html#option_mysqld_log-bin">
        <code class="option">
         --disable-log-bin
        </code>
       </a>
       is specified. If you specify
       <code class="option">
        --log-replica-updates
       </code>
       or
       <code class="option">
        --replica-preserve-commit-order
       </code>
       together
            with
       <code class="option">
        --skip-log-bin
       </code>
       or
       <code class="option">
        --disable-log-bin
       </code>
       , a warning or error
            message is issued.
      </p>
      <p>
       The server can be started with the 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
       <a class="link" href="replication-options.html#sysvar_server_id">
        <code class="literal">
         server_id
        </code>
       </a>
       system variable. For servers that are used in a replication
            topology, you must specify a unique nonzero server ID for
            each server.
      </p>
      <p>
       For information on the format and management of the binary
            log, see
       <a class="xref" href="binary-log.html" title="7.4.4 The Binary Log">
        Section 7.4.4, “The Binary Log”
       </a>
       .
      </p>
     </li>
     <li class="listitem">
      <p>
       <a name="option_mysqld_log-bin-index">
       </a>
       <a class="link" href="replication-options-binary-log.html#option_mysqld_log-bin-index">
        <code class="option">
         --log-bin-index[=
         <em class="replaceable">
          <code>
           file_name
          </code>
         </em>
         ]
        </code>
       </a>
      </p>
      <a class="indexterm" name="idm46045140893200">
      </a>
      <a class="indexterm" name="idm46045140891712">
      </a>
      <div class="informaltable">
       <table frame="box" rules="all" summary="Properties for log-bin-index">
        <colgroup>
         <col style="width: 30%"/>
         <col style="width: 70%"/>
        </colgroup>
        <tbody>
         <tr>
          <th>
           Command-Line Format
          </th>
          <td>
           <code class="literal">
            --log-bin-index=file_name
           </code>
          </td>
         </tr>
         <tr>
          <th>
           System Variable
          </th>
          <td>
           <code class="literal">
            <a class="link" href="replication-options-binary-log.html#sysvar_log_bin_index">
             log_bin_index
            </a>
           </code>
          </td>
         </tr>
         <tr>
          <th>
           Scope
          </th>
          <td>
           Global
          </td>
         </tr>
         <tr>
          <th>
           Dynamic
          </th>
          <td>
           No
          </td>
         </tr>
         <tr>
          <th>
           <a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
            <code class="literal">
             SET_VAR
            </code>
           </a>
           Hint Applies
          </th>
          <td>
           No
          </td>
         </tr>
         <tr>
          <th>
           Type
          </th>
          <td>
           File name
          </td>
         </tr>
        </tbody>
       </table>
      </div>
      <p>
       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
       <a class="link" href="replication-options-binary-log.html#option_mysqld_log-bin">
        <code class="option">
         --log-bin
        </code>
       </a>
       option, plus the extension
       <code class="filename">
        .index
       </code>
       . If
            you do not specify
       <a class="link" href="replication-options-binary-log.html#option_mysqld_log-bin">
        <code class="option">
         --log-bin
        </code>
       </a>
       ,
            the default binary log index file name is
       <code class="filename">
        binlog.index
       </code>
       . If you specify
       <a class="link" href="replication-options-binary-log.html#option_mysqld_log-bin">
        <code class="option">
         --log-bin
        </code>
       </a>
       option with no
            string or an empty string, the default binary log index file
            name is
       <code class="filename">
        <em class="replaceable">
         <code>
          host_name
         </code>
        </em>
        -bin.index
       </code>
       ,
            using the name of the host machine.
      </p>
      <p>
       For information on the format and management of the binary
            log, see
       <a class="xref" href="binary-log.html" title="7.4.4 The Binary Log">
        Section 7.4.4, “The Binary Log”
       </a>
       .
      </p>
     </li>
    </ul>
   </div>
   <p>
    <b>
     Statement selection options.
    </b>
    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
    <a class="xref" href="replication-options-replica.html" title="19.1.6.3 Replica Server Options and Variables">
     Section 19.1.6.3, “Replica Server Options and Variables”
    </a>
    .
   </p>
   <div class="itemizedlist">
    <ul class="itemizedlist" style="list-style-type: disc; ">
     <li class="listitem">
      <p>
       <a name="option_mysqld_binlog-do-db">
       </a>
       <a class="link" href="replication-options-binary-log.html#option_mysqld_binlog-do-db">
        <code class="option">
         --binlog-do-db=
         <em class="replaceable">
          <code>
           db_name
          </code>
         </em>
        </code>
       </a>
      </p>
      <a class="indexterm" name="idm46045140859856">
      </a>
      <a class="indexterm" name="idm46045140858368">
      </a>
      <div class="informaltable">
       <table frame="box" rules="all" summary="Properties for binlog-do-db">
        <colgroup>
         <col style="width: 30%"/>
         <col style="width: 70%"/>
        </colgroup>
        <tbody>
         <tr>
          <th>
           Command-Line Format
          </th>
          <td>
           <code class="literal">
            --binlog-do-db=name
           </code>
          </td>
         </tr>
         <tr>
          <th>
           Type
          </th>
          <td>
           String
          </td>
         </tr>
        </tbody>
       </table>
      </div>
      <p>
       This option affects binary logging in a manner similar to
            the way that
       <a class="link" href="replication-options-replica.html#option_mysqld_replicate-do-db">
        <code class="option">
         --replicate-do-db
        </code>
       </a>
       affects
            replication.
      </p>
      <p>
       The effects of this option depend on whether the
            statement-based or row-based logging format is in use, in
            the same way that the effects of
       <a class="link" href="replication-options-replica.html#option_mysqld_replicate-do-db">
        <code class="option">
         --replicate-do-db
        </code>
       </a>
       depend on
            whether statement-based or row-based replication is in use.
            You should keep in mind that the format used to log a given
            statement may not necessarily be the same as that indicated
            by the value of
       <a class="link" href="replication-options-binary-log.html#sysvar_binlog_format">
        <code class="literal">
         binlog_format
        </code>
       </a>
       . For example,
            DDL statements such as
       <a class="link" href="create-table.html" title="15.1.20 CREATE TABLE Statement">
        <code class="literal">
         CREATE
            TABLE
        </code>
       </a>
       and
       <a class="link" href="alter-table.html" title="15.1.9 ALTER TABLE Statement">
        <code class="literal">
         ALTER
            TABLE
        </code>
       </a>
       are always logged as statements, without
            regard to the logging format in effect, so the following
            statement-based rules for
       <code class="option">
        --binlog-do-db
       </code>
       always apply in determining whether or not the statement is
            logged.
      </p>
      <p>
       <b>
        Statement-based logging.
       </b>
       Only those statements are written to the binary log where
              the default database (that is, the one selected by
       <a class="link" href="use.html" title="15.8.4 USE Statement">
        <code class="literal">
         USE
        </code>
       </a>
       ) is
       <em class="replaceable">
        <code>
         db_name
        </code>
       </em>
       . To specify more than
              one database, use this option multiple times, once for
              each database; however, doing so does
       <span class="emphasis">
        <em>
         not
        </em>
       </span>
       cause cross-database statements
              such as
       <code class="literal">
        UPDATE
        <em class="replaceable">
         <code>
          some_db.some_table
         </code>
        </em>
        SET
              foo='bar'
       </code>
       to be logged while a different
              database (or no database) is selected.
      </p>
      <div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
       <div class="admon-title">
        Warning
       </div>
       <p>
        To specify multiple databases you
        <span class="emphasis">
         <em>
          must
         </em>
        </span>
        use multiple instances of this
              option. Because database names can contain commas, the
              list is treated as the name of a single database if you
              supply a comma-separated list.
       </p>
      </div>
      <p>
       An example of what does not work as you might expect when
            using statement-based logging: If the server is started with
       <a class="link" href="replication-options-binary-log.html#option_mysqld_binlog-do-db">
        <code class="option">
         --binlog-do-db=sales
        </code>
       </a>
       and you
            issue the following statements, the
       <a class="link" href="update.html" title="15.2.17 UPDATE Statement">
        <code class="literal">
         UPDATE
        </code>
       </a>
       statement is
       <span class="emphasis">
        <em>
         not
        </em>
       </span>
       logged:
      </p>
      <div class="copytoclipboard-wrapper">
       <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa96905284"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-sql"><span class="token keyword">USE</span> prices<span class="token punctuation">;</span>
<span class="token keyword">UPDATE</span> sales<span class="token punctuation">.</span>january <span class="token keyword">SET</span> amount<span class="token operator">=</span>amount<span class="token operator">+</span><span class="token number">1000</span><span class="token punctuation">;</span></code></pre>
      </div>
      <p>
       The main reason for this
       <span class="quote">
        “
        <span class="quote">
         just check the default
            database
        </span>
        ”
       </span>
       behavior is that it is difficult from the
            statement alone to know whether it should be replicated (for
            example, if you are using multiple-table
       <a class="link" href="delete.html" title="15.2.2 DELETE Statement">
        <code class="literal">
         DELETE
        </code>
       </a>
       statements or
            multiple-table
       <a class="link" href="update.html" title="15.2.17 UPDATE Statement">
        <code class="literal">
         UPDATE
        </code>
       </a>
       statements that act across multiple databases). It is also
            faster to check only the default database rather than all
            databases if there is no need.
      </p>
      <p>
       Another case which may not be self-evident occurs when a
            given database is replicated even though it was not
            specified when setting the option. If the server is started
            with
       <code class="option">
        --binlog-do-db=sales
       </code>
       , the following
       <a class="link" href="update.html" title="15.2.17 UPDATE Statement">
        <code class="literal">
         UPDATE
        </code>
       </a>
       statement is logged
            even though
       <code class="literal">
        prices
       </code>
       was not included when
            setting
       <code class="option">
        --binlog-do-db
       </code>
       :
      </p>
      <div class="copytoclipboard-wrapper">
       <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa19129214"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-sql"><span class="token keyword">USE</span> sales<span class="token punctuation">;</span>
<span class="token keyword">UPDATE</span> prices<span class="token punctuation">.</span>discounts <span class="token keyword">SET</span> percentage <span class="token operator">=</span> percentage <span class="token operator">+</span> <span class="token number">10</span><span class="token punctuation">;</span></code></pre>
      </div>
      <p>
       Because
       <code class="literal">
        sales
       </code>
       is the default database
            when the
       <a class="link" href="update.html" title="15.2.17 UPDATE Statement">
        <code class="literal">
         UPDATE
        </code>
       </a>
       statement is
            issued, the
       <a class="link" href="update.html" title="15.2.17 UPDATE Statement">
        <code class="literal">
         UPDATE
        </code>
       </a>
       is logged.
      </p>
      <p>
       <b>
        Row-based logging.
       </b>
       Logging is restricted to database
       <em class="replaceable">
        <code>
         db_name
        </code>
       </em>
       . Only changes to tables
              belonging to
       <em class="replaceable">
        <code>
         db_name
        </code>
       </em>
       are
              logged; the default database has no effect on this.
              Suppose that the server is started with
       <a class="link" href="replication-options-binary-log.html#option_mysqld_binlog-do-db">
        <code class="option">
         --binlog-do-db=sales
        </code>
       </a>
       and
              row-based logging is in effect, and then the following
              statements are executed:
      </p>
      <div class="copytoclipboard-wrapper">
       <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa27066417"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-sql"><span class="token keyword">USE</span> prices<span class="token punctuation">;</span>
<span class="token keyword">UPDATE</span> sales<span class="token punctuation">.</span>february <span class="token keyword">SET</span> amount<span class="token operator">=</span>amount<span class="token operator">+</span><span class="token number">100</span><span class="token punctuation">;</span></code></pre>
      </div>
      <p>
       The changes to the
       <code class="literal">
        february
       </code>
       table in the
       <code class="literal">
        sales
       </code>
       database are logged in accordance
            with the
       <a class="link" href="update.html" title="15.2.17 UPDATE Statement">
        <code class="literal">
         UPDATE
        </code>
       </a>
       statement;
            this occurs whether or not the
       <a class="link" href="use.html" title="15.8.4 USE Statement">
        <code class="literal">
         USE
        </code>
       </a>
       statement was issued.
            However, when using the row-based logging format and
       <a class="link" href="replication-options-binary-log.html#option_mysqld_binlog-do-db">
        <code class="option">
         --binlog-do-db=sales
        </code>
       </a>
       , changes
            made by the following
       <a class="link" href="update.html" title="15.2.17 UPDATE Statement">
        <code class="literal">
         UPDATE
        </code>
       </a>
       are not logged:
      </p>
      <div class="copytoclipboard-wrapper">
       <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa35599520"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-sql"><span class="token keyword">USE</span> prices<span class="token punctuation">;</span>
<span class="token keyword">UPDATE</span> prices<span class="token punctuation">.</span>march <span class="token keyword">SET</span> amount<span class="token operator">=</span>amount<span class="token number">-25</span><span class="token punctuation">;</span></code></pre>
      </div>
      <p>
       Even if the
       <code class="literal">
        USE prices
       </code>
       statement were
            changed to
       <code class="literal">
        USE sales
       </code>
       , the
       <a class="link" href="update.html" title="15.2.17 UPDATE Statement">
        <code class="literal">
         UPDATE
        </code>
       </a>
       statement's
            effects would still not be written to the binary log.
      </p>
      <p>
       Another important difference in
       <a class="link" href="replication-options-binary-log.html#option_mysqld_binlog-do-db">
        <code class="option">
         --binlog-do-db
        </code>
       </a>
       handling for
            statement-based logging as opposed to the row-based logging
            occurs with regard to statements that refer to multiple
            databases. Suppose that the server is started with
       <a class="link" href="replication-options-binary-log.html#option_mysqld_binlog-do-db">
        <code class="option">
         --binlog-do-db=db1
        </code>
       </a>
       , and the
            following statements are executed:
      </p>
      <div class="copytoclipboard-wrapper">
       <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa65042111"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-sql"><span class="token keyword">USE</span> db1<span class="token punctuation">;</span>
<span class="token keyword">UPDATE</span> db1<span class="token punctuation">.</span>table1<span class="token punctuation">,</span> db2<span class="token punctuation">.</span>table2 <span class="token keyword">SET</span> db1<span class="token punctuation">.</span>table1<span class="token punctuation">.</span>col1 <span class="token operator">=</span> <span class="token number">10</span><span class="token punctuation">,</span> db2<span class="token punctuation">.</span>table2<span class="token punctuation">.</span>col2 <span class="token operator">=</span> <span class="token number">20</span><span class="token punctuation">;</span></code></pre>
      </div>
      <p>
       If you are using statement-based logging, the updates to
            both tables are written to the binary log. However, when
            using the row-based format, only the changes to
       <code class="literal">
        table1
       </code>
       are logged;
       <code class="literal">
        table2
       </code>
       is in a different database, so it
            is not changed by the
       <a class="link" href="update.html" title="15.2.17 UPDATE Statement">
        <code class="literal">
         UPDATE
        </code>
       </a>
       .
            Now suppose that, instead of the
       <code class="literal">
        USE db1
       </code>
       statement, a
       <code class="literal">
        USE db4
       </code>
       statement had been
            used:
      </p>
      <div class="copytoclipboard-wrapper">
       <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa95586039"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-sql"><span class="token keyword">USE</span> db4<span class="token punctuation">;</span>
<span class="token keyword">UPDATE</span> db1<span class="token punctuation">.</span>table1<span class="token punctuation">,</span> db2<span class="token punctuation">.</span>table2 <span class="token keyword">SET</span> db1<span class="token punctuation">.</span>table1<span class="token punctuation">.</span>col1 <span class="token operator">=</span> <span class="token number">10</span><span class="token punctuation">,</span> db2<span class="token punctuation">.</span>table2<span class="token punctuation">.</span>col2 <span class="token operator">=</span> <span class="token number">20</span><span class="token punctuation">;</span></code></pre>
      </div>
      <p>
       In this case, the
       <a class="link" href="update.html" title="15.2.17 UPDATE Statement">
        <code class="literal">
         UPDATE
        </code>
       </a>
       statement is not written to the binary log when using
            statement-based logging. However, when using row-based
            logging, the change to
       <code class="literal">
        table1
       </code>
       is logged,
            but not that to
       <code class="literal">
        table2
       </code>
       —in other
            words, only changes to tables in the database named by
       <a class="link" href="replication-options-binary-log.html#option_mysqld_binlog-do-db">
        <code class="option">
         --binlog-do-db
        </code>
       </a>
       are logged,
            and the choice of default database has no effect on this
            behavior.
      </p>
     </li>
     <li class="listitem">
      <p>
       <a name="option_mysqld_binlog-ignore-db">
       </a>
       <a class="link" href="replication-options-binary-log.html#option_mysqld_binlog-ignore-db">
        <code class="option">
         --binlog-ignore-db=
         <em class="replaceable">
          <code>
           db_name
          </code>
         </em>
        </code>
       </a>
      </p>
      <a class="indexterm" name="idm46045140787312">
      </a>
      <a class="indexterm" name="idm46045140785824">
      </a>
      <div class="informaltable">
       <table frame="box" rules="all" summary="Properties for binlog-ignore-db">
        <colgroup>
         <col style="width: 30%"/>
         <col style="width: 70%"/>
        </colgroup>
        <tbody>
         <tr>
          <th>
           Command-Line Format
          </th>
          <td>
           <code class="literal">
            --binlog-ignore-db=name
           </code>
          </td>
         </tr>
         <tr>
          <th>
           Type
          </th>
          <td>
           String
          </td>
         </tr>
        </tbody>
       </table>
      </div>
      <p>
       This option affects binary logging in a manner similar to
            the way that
       <a class="link" href="replication-options-replica.html#option_mysqld_replicate-ignore-db">
        <code class="option">
         --replicate-ignore-db
        </code>
       </a>
       affects
            replication.
      </p>
      <p>
       The effects of this option depend on whether the
            statement-based or row-based logging format is in use, in
            the same way that the effects of
       <a class="link" href="replication-options-replica.html#option_mysqld_replicate-ignore-db">
        <code class="option">
         --replicate-ignore-db
        </code>
       </a>
       depend
            on whether statement-based or row-based replication is in
            use. You should keep in mind that the format used to log a
            given statement may not necessarily be the same as that
            indicated by the value of
       <a class="link" href="replication-options-binary-log.html#sysvar_binlog_format">
        <code class="literal">
         binlog_format
        </code>
       </a>
       . For example,
            DDL statements such as
       <a class="link" href="create-table.html" title="15.1.20 CREATE TABLE Statement">
        <code class="literal">
         CREATE
            TABLE
        </code>
       </a>
       and
       <a class="link" href="alter-table.html" title="15.1.9 ALTER TABLE Statement">
        <code class="literal">
         ALTER
            TABLE
        </code>
       </a>
       are always logged as statements, without
            regard to the logging format in effect, so the following
            statement-based rules for
       <code class="option">
        --binlog-ignore-db
       </code>
       always apply in
            determining whether or not the statement is logged.
      </p>
      <p>
       <b>
        Statement-based logging.
       </b>
       Tells the server to not log any statement where the
              default database (that is, the one selected by
       <a class="link" href="use.html" title="15.8.4 USE Statement">
        <code class="literal">
         USE
        </code>
       </a>
       ) is
       <em class="replaceable">
        <code>
         db_name
        </code>
       </em>
       .
      </p>
      <p>
       When there is no default database, no
       <code class="option">
        --binlog-ignore-db
       </code>
       options are applied, and
            such statements are always logged. (Bug #11829838, Bug
            #60188)
      </p>
      <p>
       <b>
        Row-based format.
       </b>
       Tells the server not to log updates to any tables in the
              database
       <em class="replaceable">
        <code>
         db_name
        </code>
       </em>
       . The current
              database has no effect.
      </p>
      <p>
       When using statement-based logging, the following example
            does not work as you might expect. Suppose that the server
            is started with
       <a class="link" href="replication-options-binary-log.html#option_mysqld_binlog-ignore-db">
        <code class="option">
         --binlog-ignore-db=sales
        </code>
       </a>
       and
            you issue the following statements:
      </p>
      <div class="copytoclipboard-wrapper">
       <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa67112553"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-sql"><span class="token keyword">USE</span> prices<span class="token punctuation">;</span>
<span class="token keyword">UPDATE</span> sales<span class="token punctuation">.</span>january <span class="token keyword">SET</span> amount<span class="token operator">=</span>amount<span class="token operator">+</span><span class="token number">1000</span><span class="token punctuation">;</span></code></pre>
      </div>
      <p>
       The
       <a class="link" href="update.html" title="15.2.17 UPDATE Statement">
        <code class="literal">
         UPDATE
        </code>
       </a>
       statement
       <span class="emphasis">
        <em>
         is
        </em>
       </span>
       logged in such a case because
       <a class="link" href="replication-options-binary-log.html#option_mysqld_binlog-ignore-db">
        <code class="option">
         --binlog-ignore-db
        </code>
       </a>
       applies
            only to the default database (determined by the
       <a class="link" href="use.html" title="15.8.4 USE Statement">
        <code class="literal">
         USE
        </code>
       </a>
       statement). Because the
       <code class="literal">
        sales
       </code>
       database was specified explicitly
            in the statement, the statement has not been filtered.
            However, when using row-based logging, the
       <a class="link" href="update.html" title="15.2.17 UPDATE Statement">
        <code class="literal">
         UPDATE
        </code>
       </a>
       statement's
            effects are
       <span class="emphasis">
        <em>
         not
        </em>
       </span>
       written to the binary
            log, which means that no changes to the
       <code class="literal">
        sales.january
       </code>
       table are logged; in this
            instance,
       <a class="link" href="replication-options-binary-log.html#option_mysqld_binlog-ignore-db">
        <code class="option">
         --binlog-ignore-db=sales
        </code>
       </a>
       causes
       <span class="emphasis">
        <em>
         all
        </em>
       </span>
       changes made to tables in
            the source's copy of the
       <code class="literal">
        sales
       </code>
       database to be ignored for purposes of binary logging.
      </p>
      <p>
       To specify more than one database to ignore, use this option
            multiple times, once for each database. Because database
            names can contain commas, the list is treated as the name of
            a single database if you supply a comma-separated list.
      </p>
      <p>
       You should not use this option if you are using
            cross-database updates and you do not want these updates to
            be logged.
      </p>
     </li>
    </ul>
   </div>
   <p>
    <a name="replication-optvars-binlog-checksums">
    </a>
    <b>
     Checksum options.
    </b>
    MySQL supports reading and writing of binary log checksums.
          These are enabled using the two options listed here:
   </p>
   <div class="itemizedlist">
    <ul class="itemizedlist" style="list-style-type: disc; ">
     <li class="listitem">
      <p>
       <a name="option_mysqld_binlog-checksum">
       </a>
       <a class="link" href="replication-options-binary-log.html#option_mysqld_binlog-checksum">
        <code class="option">
         --binlog-checksum={NONE|CRC32}
        </code>
       </a>
      </p>
      <a class="indexterm" name="idm46045140745104">
      </a>
      <a class="indexterm" name="idm46045140743616">
      </a>
      <div class="informaltable">
       <table frame="box" rules="all" summary="Properties for binlog-checksum">
        <colgroup>
         <col style="width: 30%"/>
         <col style="width: 70%"/>
        </colgroup>
        <tbody>
         <tr>
          <th>
           Command-Line Format
          </th>
          <td>
           <code class="literal">
            --binlog-checksum=type
           </code>
          </td>
         </tr>
         <tr>
          <th>
           Type
          </th>
          <td>
           String
          </td>
         </tr>
         <tr>
          <th>
           Default Value
          </th>
          <td>
           <code class="literal">
            CRC32
           </code>
          </td>
         </tr>
         <tr>
          <th>
           Valid Values
          </th>
          <td>
           <p class="valid-value">
            <code class="literal">
             NONE
            </code>
           </p>
           <p class="valid-value">
            <code class="literal">
             CRC32
            </code>
           </p>
          </td>
         </tr>
        </tbody>
       </table>
      </div>
      <p>
       Enabling this option causes the source to write checksums
            for events written to the binary log. Set to
       <code class="literal">
        NONE
       </code>
       to disable, or the name of the
            algorithm to be used for generating checksums; currently,
            only CRC32 checksums are supported, and CRC32 is the
            default. You cannot change the setting for this option
            within a transaction.
      </p>
     </li>
    </ul>
   </div>
   <p>
    To control reading of checksums by the replica (from the relay
        log), use the
    <a class="link" href="replication-options-replica.html#sysvar_replica_sql_verify_checksum">
     <code class="option">
      --replica-sql-verify-checksum
     </code>
    </a>
    option.
   </p>
   <p>
    <b>
     Testing and debugging options.
    </b>
    The following binary log options are used in replication
          testing and debugging. They are not intended for use in normal
          operations.
   </p>
   <div class="itemizedlist">
    <ul class="itemizedlist" style="list-style-type: disc; ">
     <li class="listitem">
      <p>
       <a name="option_mysqld_max-binlog-dump-events">
       </a>
       <a class="link" href="replication-options-binary-log.html#option_mysqld_max-binlog-dump-events">
        <code class="option">
         --max-binlog-dump-events=
         <em class="replaceable">
          <code>
           N
          </code>
         </em>
        </code>
       </a>
      </p>
      <a class="indexterm" name="idm46045140720368">
      </a>
      <a class="indexterm" name="idm46045140718864">
      </a>
      <div class="informaltable">
       <table frame="box" rules="all" summary="Properties for max-binlog-dump-events">
        <colgroup>
         <col style="width: 30%"/>
         <col style="width: 70%"/>
        </colgroup>
        <tbody>
         <tr>
          <th>
           Command-Line Format
          </th>
          <td>
           <code class="literal">
            --max-binlog-dump-events=#
           </code>
          </td>
         </tr>
         <tr>
          <th>
           Type
          </th>
          <td>
           Integer
          </td>
         </tr>
         <tr>
          <th>
           Default Value
          </th>
          <td>
           <code class="literal">
            0
           </code>
          </td>
         </tr>
        </tbody>
       </table>
      </div>
      <p>
       This option is used internally by the MySQL test suite for
            replication testing and debugging.
      </p>
     </li>
     <li class="listitem">
      <p>
       <a name="option_mysqld_sporadic-binlog-dump-fail">
       </a>
       <a class="link" href="replication-options-binary-log.html#option_mysqld_sporadic-binlog-dump-fail">
        <code class="option">
         --sporadic-binlog-dump-fail
        </code>
       </a>
      </p>
      <a class="indexterm" name="idm46045140704624">
      </a>
      <a class="indexterm" name="idm46045140703120">
      </a>
      <div class="informaltable">
       <table frame="box" rules="all" summary="Properties for sporadic-binlog-dump-fail">
        <colgroup>
         <col style="width: 30%"/>
         <col style="width: 70%"/>
        </colgroup>
        <tbody>
         <tr>
          <th>
           Command-Line Format
          </th>
          <td>
           <code class="literal">
            --sporadic-binlog-dump-fail[={OFF|ON}]
           </code>
          </td>
         </tr>
         <tr>
          <th>
           Type
          </th>
          <td>
           Boolean
          </td>
         </tr>
         <tr>
          <th>
           Default Value
          </th>
          <td>
           <code class="literal">
            OFF
           </code>
          </td>
         </tr>
        </tbody>
       </table>
      </div>
      <p>
       This option is used internally by the MySQL test suite for
            replication testing and debugging.
      </p>
     </li>
    </ul>
   </div>
  </div>
  <div class="simplesect">
   <div class="titlepage">
    <div>
     <div class="simple">
      <h5 class="title">
       <a name="replication-sysvars-binlog">
       </a>
       System Variables Used with Binary Logging
      </h5>
     </div>
    </div>
   </div>
   <p>
    The following list describes system variables for controlling
        binary logging. They can be set at server startup and some of
        them can be changed at runtime using
    <a class="link" href="set-variable.html" title="15.7.6.1 SET Syntax for Variable Assignment">
     <code class="literal">
      SET
     </code>
    </a>
    .
        Server options used to control binary logging are listed earlier
        in this section.
   </p>
   <div class="itemizedlist">
    <ul class="itemizedlist" style="list-style-type: disc; ">
     <li class="listitem">
      <p>
       <a name="sysvar_binlog_cache_size">
       </a>
       <a class="link" href="replication-options-binary-log.html#sysvar_binlog_cache_size">
        <code class="literal">
         binlog_cache_size
        </code>
       </a>
      </p>
      <a class="indexterm" name="idm46045140685056">
      </a>
      <a class="indexterm" name="idm46045140684016">
      </a>
      <div class="informaltable">
       <table frame="box" rules="all" summary="Properties for binlog_cache_size">
        <colgroup>
         <col style="width: 30%"/>
         <col style="width: 70%"/>
        </colgroup>
        <tbody>
         <tr>
          <th>
           Command-Line Format
          </th>
          <td>
           <code class="literal">
            --binlog-cache-size=#
           </code>
          </td>
         </tr>
         <tr>
          <th>
           System Variable
          </th>
          <td>
           <code class="literal">
            <a class="link" href="replication-options-binary-log.html#sysvar_binlog_cache_size">
             binlog_cache_size
            </a>
           </code>
          </td>
         </tr>
         <tr>
          <th>
           Scope
          </th>
          <td>
           Global
          </td>
         </tr>
         <tr>
          <th>
           Dynamic
          </th>
          <td>
           Yes
          </td>
         </tr>
         <tr>
          <th>
           <a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
            <code class="literal">
             SET_VAR
            </code>
           </a>
           Hint Applies
          </th>
          <td>
           No
          </td>
         </tr>
         <tr>
          <th>
           Type
          </th>
          <td>
           Integer
          </td>
         </tr>
         <tr>
          <th>
           Default Value
          </th>
          <td>
           <code class="literal">
            32768
           </code>
          </td>
         </tr>
         <tr>
          <th>
           Minimum Value
          </th>
          <td>
           <code class="literal">
            4096
           </code>
          </td>
         </tr>
         <tr>
          <th>
           Maximum Value (64-bit platforms)
          </th>
          <td>
           <code class="literal">
            18446744073709547520
           </code>
          </td>
         </tr>
         <tr>
          <th>
           Maximum Value (32-bit platforms)
          </th>
          <td>
           <code class="literal">
            4294963200
           </code>
          </td>
         </tr>
         <tr>
          <th>
           Unit
          </th>
          <td>
           bytes
          </td>
         </tr>
         <tr>
          <th>
           <a class="link" href="server-system-variables.html#system-variables-block-size" title="Note">
            Block Size
           </a>
          </th>
          <td>
           <code class="literal">
            4096
           </code>
          </td>
         </tr>
        </tbody>
       </table>
      </div>
      <p>
       The size of the memory buffer to hold changes to the binary
            log during a transaction.
      </p>
      <p>
       When binary logging is enabled on the server (with the
       <a class="link" href="replication-options-binary-log.html#sysvar_log_bin">
        <code class="literal">
         log_bin
        </code>
       </a>
       system variable set
            to ON), a binary log cache is allocated for each client if
            the server supports any transactional storage engines. If
            the data for the transaction exceeds the space in the memory
            buffer, the excess data is stored in a temporary file. When
            binary log encryption is active on the server, the memory
            buffer is not encrypted, but any temporary file used to hold
            the binary log cache is encrypted. After each transaction is
            committed, the binary log cache is reset by clearing the
            memory buffer and truncating the temporary file if used.
      </p>
      <p>
       If you often use large transactions, you can increase this
            cache size to get better performance by reducing or
            eliminating the need to write to temporary files. The
       <a class="link" href="server-status-variables.html#statvar_Binlog_cache_use">
        <code class="literal">
         Binlog_cache_use
        </code>
       </a>
       and
       <a class="link" href="server-status-variables.html#statvar_Binlog_cache_disk_use">
        <code class="literal">
         Binlog_cache_disk_use
        </code>
       </a>
       status variables can be useful for tuning the size of this
            variable. See
       <a class="xref" href="binary-log.html" title="7.4.4 The Binary Log">
        Section 7.4.4, “The Binary Log”
       </a>
       .
      </p>
      <p>
       <code class="literal">
        binlog_cache_size
       </code>
       sets the size for the
            transaction cache only; the size of the statement cache is
            governed by the
       <a class="link" href="replication-options-binary-log.html#sysvar_binlog_stmt_cache_size">
        <code class="literal">
         binlog_stmt_cache_size
        </code>
       </a>
       system variable.
      </p>
     </li>
     <li class="listitem">
      <p>
       <a name="sysvar_binlog_checksum">
       </a>
       <a class="link" href="replication-options-binary-log.html#sysvar_binlog_checksum">
        <code class="literal">
         binlog_checksum
        </code>
       </a>
      </p>
      <a class="indexterm" name="idm46045140637648">
      </a>
      <a class="indexterm" name="idm46045140636560">
      </a>
      <div class="informaltable">
       <table frame="box" rules="all" summary="Properties for binlog_checksum">
        <colgroup>
         <col style="width: 30%"/>
         <col style="width: 70%"/>
        </colgroup>
        <tbody>
         <tr>
          <th>
           Command-Line Format
          </th>
          <td>
           <code class="literal">
            --binlog-checksum=type
           </code>
          </td>
         </tr>
         <tr>
          <th>
           System Variable
          </th>
          <td>
           <code class="literal">
            <a class="link" href="replication-options-binary-log.html#sysvar_binlog_checksum">
             binlog_checksum
            </a>
           </code>
          </td>
         </tr>
         <tr>
          <th>
           Scope
          </th>
          <td>
           Global
          </td>
         </tr>
         <tr>
          <th>
           Dynamic
          </th>
          <td>
           Yes
          </td>
         </tr>
         <tr>
          <th>
           <a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
            <code class="literal">
             SET_VAR
            </code>
           </a>
           Hint Applies
          </th>
          <td>
           No
          </td>
         </tr>
         <tr>
          <th>
           Type
          </th>
          <td>
           String
          </td>
         </tr>
         <tr>
          <th>
           Default Value
          </th>
          <td>
           <code class="literal">
            CRC32
           </code>
          </td>
         </tr>
         <tr>
          <th>
           Valid Values
          </th>
          <td>
           <p class="valid-value">
            <code class="literal">
             NONE
            </code>
           </p>
           <p class="valid-value">
            <code class="literal">
             CRC32
            </code>
           </p>
          </td>
         </tr>
        </tbody>
       </table>
      </div>
      <p>
       When enabled, this variable causes the source to write a
            checksum for each event in the binary log.
       <code class="literal">
        binlog_checksum
       </code>
       supports the values
       <code class="literal">
        NONE
       </code>
       (which disables checksums) and
       <code class="literal">
        CRC32
       </code>
       . The default is
       <code class="literal">
        CRC32
       </code>
       . When
       <code class="literal">
        binlog_checksum
       </code>
       is disabled (value
       <code class="literal">
        NONE
       </code>
       ), the server verifies that it is
            writing only complete events to the binary log by writing
            and checking the event length (rather than a checksum) for
            each event.
      </p>
      <p>
       Setting this variable on the source to a value unrecognized
            by the replica causes the replica to set its own
       <code class="literal">
        binlog_checksum
       </code>
       value to
       <code class="literal">
        NONE
       </code>
       , and to stop replication with an
            error. If backward compatibility with older replicas is a
            concern, you may want to set the value explicitly to
       <code class="literal">
        NONE
       </code>
       .
      </p>
      <p>
       Group Replication in MySQL 8.4 supports
            checksums, so group members may use the default setting.
      </p>
      <p>
       Changing the value of
       <code class="literal">
        binlog_checksum
       </code>
       causes the binary log to be rotated, because checksums must
            be written for an entire binary log file, and never for only
            part of one. You cannot change the value of
       <code class="literal">
        binlog_checksum
       </code>
       within a transaction.
      </p>
      <p>
       When binary log transaction compression is enabled using the
       <a class="link" href="replication-options-binary-log.html#sysvar_binlog_transaction_compression">
        <code class="literal">
         binlog_transaction_compression
        </code>
       </a>
       system variable, checksums are not written for individual
            events in a compressed transaction payload. Instead a
            checksum is written for the GTID event, and a checksum for
            the compressed
       <code class="literal">
        Transaction_payload_event
       </code>
       .
      </p>
     </li>
     <li class="listitem">
      <p>
       <a name="sysvar_binlog_direct_non_transactional_updates">
       </a>
       <a class="link" href="replication-options-binary-log.html#sysvar_binlog_direct_non_transactional_updates">
        <code class="literal">
         binlog_direct_non_transactional_updates
        </code>
       </a>
      </p>
      <a class="indexterm" name="idm46045140595200">
      </a>
      <a class="indexterm" name="idm46045140594160">
      </a>
      <div class="informaltable">
       <table frame="box" rules="all" summary="Properties for binlog_direct_non_transactional_updates">
        <colgroup>
         <col style="width: 30%"/>
         <col style="width: 70%"/>
        </colgroup>
        <tbody>
         <tr>
          <th>
           Command-Line Format
          </th>
          <td>
           <code class="literal">
            --binlog-direct-non-transactional-updates[={OFF|ON}]
           </code>
          </td>
         </tr>
         <tr>
          <th>
           System Variable
          </th>
          <td>
           <code class="literal">
            <a class="link" href="replication-options-binary-log.html#sysvar_binlog_direct_non_transactional_updates">
             binlog_direct_non_transactional_updates
            </a>
           </code>
          </td>
         </tr>
         <tr>
          <th>
           Scope
          </th>
          <td>
           Global, Session
          </td>
         </tr>
         <tr>
          <th>
           Dynamic
          </th>
          <td>
           Yes
          </td>
         </tr>
         <tr>
          <th>
           <a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
            <code class="literal">
             SET_VAR
            </code>
           </a>
           Hint Applies
          </th>
          <td>
           No
          </td>
         </tr>
         <tr>
          <th>
           Type
          </th>
          <td>
           Boolean
          </td>
         </tr>
         <tr>
          <th>
           Default Value
          </th>
          <td>
           <code class="literal">
            OFF
           </code>
          </td>
         </tr>
        </tbody>
       </table>
      </div>
      <p>
       Due to concurrency issues, a replica can become inconsistent
            when a transaction contains updates to both transactional
            and nontransactional tables. MySQL tries to preserve
            causality among these statements by writing nontransactional
            statements to the transaction cache, which is flushed upon
            commit. However, problems arise when modifications done to
            nontransactional tables on behalf of a transaction become
            immediately visible to other connections because these
            changes may not be written immediately into the binary log.
      </p>
      <p>
       The
       <a class="link" href="replication-options-binary-log.html#sysvar_binlog_direct_non_transactional_updates">
        <code class="literal">
         binlog_direct_non_transactional_updates
        </code>
       </a>
       variable offers one possible workaround to this issue. By
            default, this variable is disabled. Enabling
       <a class="link" href="replication-options-binary-log.html#sysvar_binlog_direct_non_transactional_updates">
        <code class="literal">
         binlog_direct_non_transactional_updates
        </code>
       </a>
       causes updates to nontransactional tables to be written
            directly to the binary log, rather than to the transaction
            cache.
      </p>
      <p>
       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
       <a class="xref" href="system-variable-privileges.html" title="7.1.9.1 System Variable Privileges">
        Section 7.1.9.1, “System Variable Privileges”
       </a>
       .
      </p>
      <p>
       <span class="emphasis">
        <em>
         <a class="link" href="replication-options-binary-log.html#sysvar_binlog_direct_non_transactional_updates">
          <code class="literal">
           binlog_direct_non_transactional_updates
          </code>
         </a>
         works only for statements that are replicated using the
            statement-based binary logging format
        </em>
       </span>
       ; that is,
            it works only when the value of
       <a class="link" href="replication-options-binary-log.html#sysvar_binlog_format">
        <code class="literal">
         binlog_format
        </code>
       </a>
       is
       <code class="literal">
        STATEMENT
       </code>
       , or when
       <a class="link" href="replication-options-binary-log.html#sysvar_binlog_format">
        <code class="literal">
         binlog_format
        </code>
       </a>
       is
       <code class="literal">
        MIXED
       </code>
       and a given statement is being
            replicated using the statement-based format. This variable
            has no effect when the binary log format is
       <code class="literal">
        ROW
       </code>
       , or when
       <a class="link" href="replication-options-binary-log.html#sysvar_binlog_format">
        <code class="literal">
         binlog_format
        </code>
       </a>
       is set to
       <code class="literal">
        MIXED
       </code>
       and a given statement is replicated
            using the row-based format.
      </p>
      <div class="important" style="margin-left: 0.5in; margin-right: 0.5in;">
       <div class="admon-title">
        Important
       </div>
       <p>
        Before enabling this variable, you must make certain that
              there are no dependencies between transactional and
              nontransactional tables; an example of such a dependency
              would be the statement
        <code class="literal">
         INSERT INTO myisam_table
              SELECT * FROM innodb_table
        </code>
        . Otherwise, such
              statements are likely to cause the replica to diverge from
              the source.
       </p>
      </div>
      <p>
       This variable has no effect when the binary log format is
       <code class="literal">
        ROW
       </code>
       or
       <code class="literal">
        MIXED
       </code>
       .
      </p>
     </li>
     <li class="listitem">
      <p>
       <a name="sysvar_binlog_encryption">
       </a>
       <a class="link" href="replication-options-binary-log.html#sysvar_binlog_encryption">
        <code class="literal">
         binlog_encryption
        </code>
       </a>
      </p>
      <a class="indexterm" name="idm46045140551520">
      </a>
      <a class="indexterm" name="idm46045140550480">
      </a>
      <div class="informaltable">
       <table frame="box" rules="all" summary="Properties for binlog_encryption">
        <colgroup>
         <col style="width: 30%"/>
         <col style="width: 70%"/>
        </colgroup>
        <tbody>
         <tr>
          <th>
           Command-Line Format
          </th>
          <td>
           <code class="literal">
            --binlog-encryption[={OFF|ON}]
           </code>
          </td>
         </tr>
         <tr>
          <th>
           System Variable
          </th>
          <td>
           <code class="literal">
            <a class="link" href="replication-options-binary-log.html#sysvar_binlog_encryption">
             binlog_encryption
            </a>
           </code>
          </td>
         </tr>
         <tr>
          <th>
           Scope
          </th>
          <td>
           Global
          </td>
         </tr>
         <tr>
          <th>
           Dynamic
          </th>
          <td>
           Yes
          </td>
         </tr>
         <tr>
          <th>
           <a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
            <code class="literal">
             SET_VAR
            </code>
           </a>
           Hint Applies
          </th>
          <td>
           No
          </td>
         </tr>
         <tr>
          <th>
           Type
          </th>
          <td>
           Boolean
          </td>
         </tr>
         <tr>
          <th>
           Default Value
          </th>
          <td>
           <code class="literal">
            OFF
           </code>
          </td>
         </tr>
        </tbody>
       </table>
      </div>
      <p>
       Enables encryption for binary log files and relay log files
            on this server.
       <code class="literal">
        OFF
       </code>
       is the default.
       <code class="literal">
        ON
       </code>
       sets encryption on for binary log
            files and relay log files. Binary logging does not need to
            be enabled on the server to enable encryption, so you can
            encrypt the relay log files on a replica that has no binary
            log. To use encryption, a keyring plugin must be installed
            and configured to supply MySQL Server's keyring service. For
            instructions to do this, see
       <a class="xref" href="keyring.html" title="8.4.4 The MySQL Keyring">
        Section 8.4.4, “The MySQL Keyring”
       </a>
       . Any
            supported keyring plugin can be used to store binary log
            encryption keys.
      </p>
      <p>
       When you first start the server with binary log encryption
            enabled, a new binary log encryption key is generated before
            the binary log and relay logs are initialized. This key is
            used to encrypt a file password for each binary log file (if
            the server has binary logging enabled) and relay log file
            (if the server has replication channels), and further keys
            generated from the file passwords are used to encrypt the
            data in the files. Relay log files are encrypted for all
            channels, including Group Replication applier channels and
            new channels that are created after encryption is activated.
            The binary log index file and relay log index file are never
            encrypted.
      </p>
      <p>
       If you activate encryption while the server is running, a
            new binary log encryption key is generated at that time. The
            exception is if encryption was active previously on the
            server and was then disabled, in which case the binary log
            encryption key that was in use before is used again. The
            binary log file and relay log files are rotated immediately,
            and file passwords for the new files and all subsequent
            binary log files and relay log files are encrypted using
            this binary log encryption key. Existing binary log files
            and relay log files still present on the server are not
            automatically encrypted, but you can purge them if they are
            no longer needed.
      </p>
      <p>
       If you deactivate encryption by changing the
       <a class="link" href="replication-options-binary-log.html#sysvar_binlog_encryption">
        <code class="literal">
         binlog_encryption
        </code>
       </a>
       system
            variable to
       <code class="literal">
        OFF
       </code>
       , the binary log file and
            relay log files are rotated immediately and all subsequent
            logging is unencrypted. Previously encrypted files are not
            automatically decrypted, but the server is still able to
            read them. The
       <code class="literal">
        BINLOG_ENCRYPTION_ADMIN
       </code>
       privilege (or the deprecated
       <a class="link" href="privileges-provided.html#priv_super">
        <code class="literal">
         SUPER
        </code>
       </a>
       privilege) is required
            to activate or deactivate encryption while the server is
            running. Group Replication applier channels are not included
            in the relay log rotation request, so unencrypted logging
            for these channels does not start until their logs are
            rotated in normal use.
      </p>
      <p>
       For more information on binary log file and relay log file
            encryption, see
       <a class="xref" href="replication-binlog-encryption.html" title="19.3.2 Encrypting Binary Log Files and Relay Log Files">
        Section 19.3.2, “Encrypting Binary Log Files and Relay Log Files”
       </a>
       .
      </p>
     </li>
     <li class="listitem">
      <p>
       <a name="sysvar_binlog_error_action">
       </a>
       <a class="link" href="replication-options-binary-log.html#sysvar_binlog_error_action">
        <code class="literal">
         binlog_error_action
        </code>
       </a>
      </p>
      <a class="indexterm" name="idm46045140514608">
      </a>
      <a class="indexterm" name="idm46045140513568">
      </a>
      <div class="informaltable">
       <table frame="box" rules="all" summary="Properties for binlog_error_action">
        <colgroup>
         <col style="width: 30%"/>
         <col style="width: 70%"/>
        </colgroup>
        <tbody>
         <tr>
          <th>
           Command-Line Format
          </th>
          <td>
           <code class="literal">
            --binlog-error-action[=value]
           </code>
          </td>
         </tr>
         <tr>
          <th>
           System Variable
          </th>
          <td>
           <code class="literal">
            <a class="link" href="replication-options-binary-log.html#sysvar_binlog_error_action">
             binlog_error_action
            </a>
           </code>
          </td>
         </tr>
         <tr>
          <th>
           Scope
          </th>
          <td>
           Global
          </td>
         </tr>
         <tr>
          <th>
           Dynamic
          </th>
          <td>
           Yes
          </td>
         </tr>
         <tr>
          <th>
           <a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
            <code class="literal">
             SET_VAR
            </code>
           </a>
           Hint Applies
          </th>
          <td>
           No
          </td>
         </tr>
         <tr>
          <th>
           Type
          </th>
          <td>
           Enumeration
          </td>
         </tr>
         <tr>
          <th>
           Default Value
          </th>
          <td>
           <code class="literal">
            ABORT_SERVER
           </code>
          </td>
         </tr>
         <tr>
          <th>
           Valid Values
          </th>
          <td>
           <p class="valid-value">
            <code class="literal">
             IGNORE_ERROR
            </code>
           </p>
           <p class="valid-value">
            <code class="literal">
             ABORT_SERVER
            </code>
           </p>
          </td>
         </tr>
        </tbody>
       </table>
      </div>
      <p>
       Controls what happens when the server encounters an error
            such as not being able to write to, flush or synchronize the
            binary log, which can cause the source's binary log to
            become inconsistent and replicas to lose synchronization.
      </p>
      <p>
       This variable defaults to
       <code class="literal">
        ABORT_SERVER
       </code>
       ,
            which makes the server halt logging and shut down whenever
            it encounters such an error with the binary log. On restart,
            recovery proceeds as in the case of an unexpected server
            halt (see
       <a class="xref" href="replication-solutions-unexpected-replica-halt.html" title="19.4.2 Handling an Unexpected Halt of a Replica">
        Section 19.4.2, “Handling an Unexpected Halt of a Replica”
       </a>
       ).
      </p>
      <p>
       When
       <code class="literal">
        binlog_error_action
       </code>
       is set to
       <code class="literal">
        IGNORE_ERROR
       </code>
       , if the server encounters
            such an error it continues the ongoing transaction, logs the
            error then halts logging, and continues performing updates.
            To resume binary logging
       <a class="link" href="replication-options-binary-log.html#sysvar_log_bin">
        <code class="literal">
         log_bin
        </code>
       </a>
       must be enabled
            again, which requires a server restart. This setting
            provides backward compatibility with older versions of
            MySQL.
      </p>
     </li>
     <li class="listitem">
      <p>
       <a name="sysvar_binlog_expire_logs_seconds">
       </a>
       <a class="link" href="replication-options-binary-log.html#sysvar_binlog_expire_logs_seconds">
        <code class="literal">
         binlog_expire_logs_seconds
        </code>
       </a>
      </p>
      <a class="indexterm" name="idm46045140479408">
      </a>
      <a class="indexterm" name="idm46045140478320">
      </a>
      <div class="informaltable">
       <table frame="box" rules="all" summary="Properties for binlog_expire_logs_seconds">
        <colgroup>
         <col style="width: 30%"/>
         <col style="width: 70%"/>
        </colgroup>
        <tbody>
         <tr>
          <th>
           Command-Line Format
          </th>
          <td>
           <code class="literal">
            --binlog-expire-logs-seconds=#
           </code>
          </td>
         </tr>
         <tr>
          <th>
           System Variable
          </th>
          <td>
           <code class="literal">
            <a class="link" href="replication-options-binary-log.html#sysvar_binlog_expire_logs_seconds">
             binlog_expire_logs_seconds
            </a>
           </code>
          </td>
         </tr>
         <tr>
          <th>
           Scope
          </th>
          <td>
           Global
          </td>
         </tr>
         <tr>
          <th>
           Dynamic
          </th>
          <td>
           Yes
          </td>
         </tr>
         <tr>
          <th>
           <a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
            <code class="literal">
             SET_VAR
            </code>
           </a>
           Hint Applies
          </th>
          <td>
           No
          </td>
         </tr>
         <tr>
          <th>
           Type
          </th>
          <td>
           Integer
          </td>
         </tr>
         <tr>
          <th>
           Default Value
          </th>
          <td>
           <code class="literal">
            2592000
           </code>
          </td>
         </tr>
         <tr>
          <th>
           Minimum Value
          </th>
          <td>
           <code class="literal">
            0
           </code>
          </td>
         </tr>
         <tr>
          <th>
           Maximum Value
          </th>
          <td>
           <code class="literal">
            4294967295
           </code>
          </td>
         </tr>
         <tr>
          <th>
           Unit
          </th>
          <td>
           seconds
          </td>
         </tr>
        </tbody>
       </table>
      </div>
      <p>
       Sets the binary log expiration period in seconds. After
            their expiration period ends, binary log files can be
            automatically removed. Possible removals happen at startup
            and when the binary log is flushed. Log flushing occurs as
            indicated in
       <a class="xref" href="server-logs.html" title="7.4 MySQL Server Logs">
        Section 7.4, “MySQL Server Logs”
       </a>
       .
      </p>
      <p>
       The default binary log expiration period is 2592000 seconds,
            which equals 30 days (30*24*60*60 seconds).
      </p>
      <p>
       Automatic purging of the binary log can be disabled by
            setting the
       <a class="link" href="replication-options-binary-log.html#sysvar_binlog_expire_logs_auto_purge">
        <code class="literal">
         binlog_expire_logs_auto_purge
        </code>
       </a>
       system variable to
       <code class="literal">
        OFF
       </code>
       . This takes
            precedence over any setting for
       <code class="literal">
        binlog_expire_logs_seconds
       </code>
       .
      </p>
      <p>
       To remove binary log files manually, use the
       <a class="link" href="purge-binary-logs.html" title="15.4.1.1 PURGE BINARY LOGS Statement">
        <code class="literal">
         PURGE BINARY LOGS
        </code>
       </a>
       statement.
            See
       <a class="xref" href="purge-binary-logs.html" title="15.4.1.1 PURGE BINARY LOGS Statement">
        Section 15.4.1.1, “PURGE BINARY LOGS Statement”
       </a>
       .
      </p>
     </li>
     <li class="listitem">
      <p>
       <a name="sysvar_binlog_expire_logs_auto_purge">
       </a>
       <a class="link" href="replication-options-binary-log.html#sysvar_binlog_expire_logs_auto_purge">
        <code class="literal">
         binlog_expire_logs_auto_purge
        </code>
       </a>
      </p>
      <a class="indexterm" name="idm46045140439696">
      </a>
      <a class="indexterm" name="idm46045140438592">
      </a>
      <div class="informaltable">
       <table frame="box" rules="all" summary="Properties for binlog_expire_logs_auto_purge">
        <colgroup>
         <col style="width: 30%"/>
         <col style="width: 70%"/>
        </colgroup>
        <tbody>
         <tr>
          <th>
           Command-Line Format
          </th>
          <td>
           <code class="literal">
            --binlog-expire-logs-auto-purge={ON|OFF}
           </code>
          </td>
         </tr>
         <tr>
          <th>
           System Variable
          </th>
          <td>
           <code class="literal">
            <a class="link" href="replication-options-binary-log.html#sysvar_binlog_expire_logs_auto_purge">
             binlog_expire_logs_auto_purge
            </a>
           </code>
          </td>
         </tr>
         <tr>
          <th>
           Scope
          </th>
          <td>
           Global
          </td>
         </tr>
         <tr>
          <th>
           Dynamic
          </th>
          <td>
           Yes
          </td>
         </tr>
         <tr>
          <th>
           <a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
            <code class="literal">
             SET_VAR
            </code>
           </a>
           Hint Applies
          </th>
          <td>
           No
          </td>
         </tr>
         <tr>
          <th>
           Type
          </th>
          <td>
           Boolean
          </td>
         </tr>
         <tr>
          <th>
           Default Value
          </th>
          <td>
           <code class="literal">
            ON
           </code>
          </td>
         </tr>
        </tbody>
       </table>
      </div>
      <p>
       Enables or disables automatic purging of binary log files.
            Setting this variable to
       <code class="literal">
        ON
       </code>
       (the default)
            enables automatic purging; setting it to
       <code class="literal">
        OFF
       </code>
       disables automatic purging. The
            interval to wait before purging is controlled by
       <a class="link" href="replication-options-binary-log.html#sysvar_binlog_expire_logs_seconds">
        <code class="literal">
         binlog_expire_logs_seconds
        </code>
       </a>
       .
      </p>
      <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
       <div class="admon-title">
        Note
       </div>
       <p>
        Even if
        <code class="literal">
         binlog_expire_logs_auto_purge
        </code>
        is
        <code class="literal">
         ON
        </code>
        , setting
        <code class="literal">
         binlog_expire_logs_seconds
        </code>
        to
        <code class="literal">
         0
        </code>
        stops automatic purging from taking
              place.
       </p>
      </div>
      <p>
       This variable has no effect on
       <a class="link" href="purge-binary-logs.html" title="15.4.1.1 PURGE BINARY LOGS Statement">
        <code class="literal">
         PURGE
            BINARY LOGS
        </code>
       </a>
       .
      </p>
     </li>
     <li class="listitem">
      <p>
       <a name="sysvar_binlog_format">
       </a>
       <a class="link" href="replication-options-binary-log.html#sysvar_binlog_format">
        <code class="literal">
         binlog_format
        </code>
       </a>
      </p>
      <a class="indexterm" name="idm46045140405824">
      </a>
      <a class="indexterm" name="idm46045140404736">
      </a>
      <div class="informaltable">
       <table frame="box" rules="all" summary="Properties for binlog_format">
        <colgroup>
         <col style="width: 30%"/>
         <col style="width: 70%"/>
        </colgroup>
        <tbody>
         <tr>
          <th>
           Command-Line Format
          </th>
          <td>
           <code class="literal">
            --binlog-format=format
           </code>
          </td>
         </tr>
         <tr>
          <th>
           Deprecated
          </th>
          <td>
           Yes
          </td>
         </tr>
         <tr>
          <th>
           System Variable
          </th>
          <td>
           <code class="literal">
            <a class="link" href="replication-options-binary-log.html#sysvar_binlog_format">
             binlog_format
            </a>
           </code>
          </td>
         </tr>
         <tr>
          <th>
           Scope
          </th>
          <td>
           Global, Session
          </td>
         </tr>
         <tr>
          <th>
           Dynamic
          </th>
          <td>
           Yes
          </td>
         </tr>
         <tr>
          <th>
           <a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
            <code class="literal">
             SET_VAR
            </code>
           </a>
           Hint Applies
          </th>
          <td>
           No
          </td>
         </tr>
         <tr>
          <th>
           Type
          </th>
          <td>
           Enumeration
          </td>
         </tr>
         <tr>
          <th>
           Default Value
          </th>
          <td>
           <code class="literal">
            ROW
           </code>
          </td>
         </tr>
         <tr>
          <th>
           Valid Values
          </th>
          <td>
           <p class="valid-value">
            <code class="literal">
             MIXED
            </code>
           </p>
           <p class="valid-value">
            <code class="literal">
             STATEMENT
            </code>
           </p>
           <p class="valid-value">
            <code class="literal">
             ROW
            </code>
           </p>
          </td>
         </tr>
        </tbody>
       </table>
      </div>
      <p>
       This system variable sets the binary logging format, and can
            be any one of
       <code class="literal">
        STATEMENT
       </code>
       ,
       <code class="literal">
        ROW
       </code>
       , or
       <code class="literal">
        MIXED
       </code>
       . (See
       <a class="xref" href="replication-formats.html" title="19.2.1 Replication Formats">
        Section 19.2.1, “Replication Formats”
       </a>
       .) The setting takes
            effect when binary logging is enabled on the server, which
            is the case when the
       <a class="link" href="replication-options-binary-log.html#sysvar_log_bin">
        <code class="literal">
         log_bin
        </code>
       </a>
       system variable is
            set to
       <code class="literal">
        ON
       </code>
       . In MySQL 8.4,
            binary logging is enabled by default, and by default uses
            the row-based format.
      </p>
      <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
       <div class="admon-title">
        Note
       </div>
       <p>
        <code class="literal">
         binlog_format
        </code>
        is deprecated, and
              subject to removal in a future version of MySQL. This
              implies that support for logging formats other than
              row-based is also subject to removal in a future release.
              Thus, only row-based logging should be employed for any
              new MySQL Replication setups.
       </p>
      </div>
      <p>
       <a class="link" href="replication-options-binary-log.html#sysvar_binlog_format">
        <code class="literal">
         binlog_format
        </code>
       </a>
       can be set at
            startup or at runtime, except that under some conditions,
            changing this variable at runtime is not possible or causes
            replication to fail, as described later.
      </p>
      <p>
       The default is
       <code class="literal">
        ROW
       </code>
       .
       <span class="emphasis">
        <em>
         Exception
        </em>
       </span>
       : In NDB Cluster, the default
            is
       <code class="literal">
        MIXED
       </code>
       ; statement-based replication is
            not supported for NDB Cluster.
      </p>
      <p>
       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
       <a class="xref" href="system-variable-privileges.html" title="7.1.9.1 System Variable Privileges">
        Section 7.1.9.1, “System Variable Privileges”
       </a>
       .
      </p>
      <p>
       The rules governing when changes to this variable take
            effect and how long the effect lasts are the same as for
            other MySQL server system variables. For more information,
            see
       <a class="xref" href="set-variable.html" title="15.7.6.1 SET Syntax for Variable Assignment">
        Section 15.7.6.1, “SET Syntax for Variable Assignment”
       </a>
       .
      </p>
      <p>
       When
       <code class="literal">
        MIXED
       </code>
       is specified, statement-based
            replication is used, except for cases where only row-based
            replication is guaranteed to lead to proper results. For
            example, this happens when statements contain loadable
            functions or the
       <a class="link" href="miscellaneous-functions.html#function_uuid">
        <code class="literal">
         UUID()
        </code>
       </a>
       function.
      </p>
      <p>
       For details of how stored programs (stored procedures and
            functions, triggers, and events) are handled when each
            binary logging format is set, see
       <a class="xref" href="stored-programs-logging.html" title="27.7 Stored Program Binary Logging">
        Section 27.7, “Stored Program Binary Logging”
       </a>
       .
      </p>
      <p>
       There are exceptions when you cannot switch the replication
            format at runtime:
      </p>
      <div class="itemizedlist">
       <ul class="itemizedlist" style="list-style-type: circle; ">
        <li class="listitem">
         <p>
          The replication format cannot be changed from within a
                stored function or a trigger.
         </p>
        </li>
        <li class="listitem">
         <p>
          If a session has open temporary tables, the replication
                format cannot be changed for the session (
          <code class="literal">
           SET
                @@SESSION.binlog_format
          </code>
          ).
         </p>
        </li>
        <li class="listitem">
         <p>
          If any replication channel has open temporary tables,
                the replication format cannot be changed globally
                (
          <code class="literal">
           SET @@GLOBAL.binlog_format
          </code>
          or
          <code class="literal">
           SET @@PERSIST.binlog_format
          </code>
          ).
         </p>
        </li>
        <li class="listitem">
         <p>
          If any replication channel applier thread is currently
                running, the replication format cannot be changed
                globally (
          <code class="literal">
           SET @@GLOBAL.binlog_format
          </code>
          or
          <code class="literal">
           SET @@PERSIST.binlog_format
          </code>
          ).
         </p>
        </li>
       </ul>
      </div>
      <p>
       Trying to switch the replication format in any of these
            cases (or attempting to set the current replication format)
            results in an error. You can, however, use
       <code class="literal">
        PERSIST_ONLY
       </code>
       (
       <code class="literal">
        SET
            @@PERSIST_ONLY.binlog_format
       </code>
       ) to change the
            replication format at any time, because this action does not
            modify the runtime global system variable value, and takes
            effect only after a server restart.
      </p>
      <p>
       Switching the replication format at runtime is not
            recommended when any temporary tables exist, because
            temporary tables are logged only when using statement-based
            replication, whereas with row-based replication and mixed
            replication, they are not logged.
      </p>
      <p>
       Changing the logging format on a replication source server
            does not cause a replica to change its logging format to
            match. Switching the replication format while replication is
            ongoing can cause issues if a replica has binary logging
            enabled, and the change results in the replica using
       <code class="literal">
        STATEMENT
       </code>
       format logging while the source
            is using
       <code class="literal">
        ROW
       </code>
       or
       <code class="literal">
        MIXED
       </code>
       format logging. A replica is not able to convert binary log
            entries received in
       <code class="literal">
        ROW
       </code>
       logging format to
       <code class="literal">
        STATEMENT
       </code>
       format for use in its own
            binary log, so this situation can cause replication to fail.
            For more information, see
       <a class="xref" href="binary-log-setting.html" title="7.4.4.2 Setting The Binary Log Format">
        Section 7.4.4.2, “Setting The Binary Log Format”
       </a>
       .
      </p>
      <p>
       The binary log format affects the behavior of the following
            server options:
      </p>
      <div class="itemizedlist">
       <ul class="itemizedlist" style="list-style-type: circle; ">
        <li class="listitem">
         <p>
          <a class="link" href="replication-options-replica.html#option_mysqld_replicate-do-db">
           <code class="option">
            --replicate-do-db
           </code>
          </a>
         </p>
        </li>
        <li class="listitem">
         <p>
          <a class="link" href="replication-options-replica.html#option_mysqld_replicate-ignore-db">
           <code class="option">
            --replicate-ignore-db
           </code>
          </a>
         </p>
        </li>
        <li class="listitem">
         <p>
          <a class="link" href="replication-options-binary-log.html#option_mysqld_binlog-do-db">
           <code class="option">
            --binlog-do-db
           </code>
          </a>
         </p>
        </li>
        <li class="listitem">
         <p>
          <a class="link" href="replication-options-binary-log.html#option_mysqld_binlog-ignore-db">
           <code class="option">
            --binlog-ignore-db
           </code>
          </a>
         </p>
        </li>
       </ul>
      </div>
      <p>
       These effects are discussed in detail in the descriptions of
            the individual options.
      </p>
     </li>
     <li class="listitem">
      <p>
       <a name="sysvar_binlog_group_commit_sync_delay">
       </a>
       <a class="link" href="replication-options-binary-log.html#sysvar_binlog_group_commit_sync_delay">
        <code class="literal">
         binlog_group_commit_sync_delay
        </code>
       </a>
      </p>
      <a class="indexterm" name="idm46045140331024">
      </a>
      <a class="indexterm" name="idm46045140329936">
      </a>
      <div class="informaltable">
       <table frame="box" rules="all" summary="Properties for binlog_group_commit_sync_delay">
        <colgroup>
         <col style="width: 30%"/>
         <col style="width: 70%"/>
        </colgroup>
        <tbody>
         <tr>
          <th>
           Command-Line Format
          </th>
          <td>
           <code class="literal">
            --binlog-group-commit-sync-delay=#
           </code>
          </td>
         </tr>
         <tr>
          <th>
           System Variable
          </th>
          <td>
           <code class="literal">
            <a class="link" href="replication-options-binary-log.html#sysvar_binlog_group_commit_sync_delay">
             binlog_group_commit_sync_delay
            </a>
           </code>
          </td>
         </tr>
         <tr>
          <th>
           Scope
          </th>
          <td>
           Global
          </td>
         </tr>
         <tr>
          <th>
           Dynamic
          </th>
          <td>
           Yes
          </td>
         </tr>
         <tr>
          <th>
           <a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
            <code class="literal">
             SET_VAR
            </code>
           </a>
           Hint Applies
          </th>
          <td>
           No
          </td>
         </tr>
         <tr>
          <th>
           Type
          </th>
          <td>
           Integer
          </td>
         </tr>
         <tr>
          <th>
           Default Value
          </th>
          <td>
           <code class="literal">
            0
           </code>
          </td>
         </tr>
         <tr>
          <th>
           Minimum Value
          </th>
          <td>
           <code class="literal">
            0
           </code>
          </td>
         </tr>
         <tr>
          <th>
           Maximum Value
          </th>
          <td>
           <code class="literal">
            1000000
           </code>
          </td>
         </tr>
         <tr>
          <th>
           Unit
          </th>
          <td>
           microseconds
          </td>
         </tr>
        </tbody>
       </table>
      </div>
      <p>
       Controls how many microseconds the binary log commit waits
            before synchronizing the binary log file to disk. By default
       <a class="link" href="replication-options-binary-log.html#sysvar_binlog_group_commit_sync_delay">
        <code class="literal">
         binlog_group_commit_sync_delay
        </code>
       </a>
       is set to 0, meaning that there is no delay. Setting
       <a class="link" href="replication-options-binary-log.html#sysvar_binlog_group_commit_sync_delay">
        <code class="literal">
         binlog_group_commit_sync_delay
        </code>
       </a>
       to a microsecond delay enables more transactions to be
            synchronized together to disk at once, reducing the overall
            time to commit a group of transactions because the larger
            groups require fewer time units per group.
      </p>
      <p>
       When
       <a class="link" href="replication-options-binary-log.html#sysvar_sync_binlog">
        <code class="literal">
         sync_binlog=0
        </code>
       </a>
       or
       <a class="link" href="replication-options-binary-log.html#sysvar_sync_binlog">
        <code class="literal">
         sync_binlog=1
        </code>
       </a>
       is set, the
            delay specified by
       <a class="link" href="replication-options-binary-log.html#sysvar_binlog_group_commit_sync_delay">
        <code class="literal">
         binlog_group_commit_sync_delay
        </code>
       </a>
       is applied for every binary log commit group before
            synchronization (or in the case of
       <a class="link" href="replication-options-binary-log.html#sysvar_sync_binlog">
        <code class="literal">
         sync_binlog=0
        </code>
       </a>
       , before
            proceeding). When
       <a class="link" href="replication-options-binary-log.html#sysvar_sync_binlog">
        <code class="literal">
         sync_binlog
        </code>
       </a>
       is set to a
            value
       <span class="emphasis">
        <em>
         n
        </em>
       </span>
       greater than 1, the delay is
            applied after every
       <span class="emphasis">
        <em>
         n
        </em>
       </span>
       binary log commit
            groups.
      </p>
      <p>
       Setting
       <a class="link" href="replication-options-binary-log.html#sysvar_binlog_group_commit_sync_delay">
        <code class="literal">
         binlog_group_commit_sync_delay
        </code>
       </a>
       can increase the number of parallel committing transactions
            on any server that has (or might have after a failover) a
            replica, and therefore can increase parallel execution on
            the replicas. To benefit from this effect, the replica
            servers must have
       <a class="link" href="replication-options-replica.html#sysvar_replica_parallel_type">
        <code class="literal">
         replica_parallel_type=LOGICAL_CLOCK
        </code>
       </a>
       set. It is important to take into account both source and
            replica throughput when you are setting
       <a class="link" href="replication-options-binary-log.html#sysvar_binlog_group_commit_sync_delay">
        <code class="literal">
         binlog_group_commit_sync_delay
        </code>
       </a>
       .
      </p>
      <p>
       Setting
       <a class="link" href="replication-options-binary-log.html#sysvar_binlog_group_commit_sync_delay">
        <code class="literal">
         binlog_group_commit_sync_delay
        </code>
       </a>
       can also reduce the number of
       <code class="literal">
        fsync()
       </code>
       calls to the binary log on any server (source or replica)
            that has a binary log.
      </p>
      <p>
       Note that setting
       <a class="link" href="replication-options-binary-log.html#sysvar_binlog_group_commit_sync_delay">
        <code class="literal">
         binlog_group_commit_sync_delay
        </code>
       </a>
       increases the latency of transactions on the server, which
            might affect client applications. Also, on highly concurrent
            workloads, it is possible for the delay to increase
            contention and therefore reduce throughput. Typically, the
            benefits of setting a delay outweigh the drawbacks, but
            tuning should always be carried out to determine the optimal
            setting.
      </p>
     </li>
     <li class="listitem">
      <p>
       <a name="sysvar_binlog_group_commit_sync_no_delay_count">
       </a>
       <a class="link" href="replication-options-binary-log.html#sysvar_binlog_group_commit_sync_no_delay_count">
        <code class="literal">
         binlog_group_commit_sync_no_delay_count
        </code>
       </a>
      </p>
      <a class="indexterm" name="idm46045140278208">
      </a>
      <a class="indexterm" name="idm46045140277120">
      </a>
      <div class="informaltable">
       <table frame="box" rules="all" summary="Properties for binlog_group_commit_sync_no_delay_count">
        <colgroup>
         <col style="width: 30%"/>
         <col style="width: 70%"/>
        </colgroup>
        <tbody>
         <tr>
          <th>
           Command-Line Format
          </th>
          <td>
           <code class="literal">
            --binlog-group-commit-sync-no-delay-count=#
           </code>
          </td>
         </tr>
         <tr>
          <th>
           System Variable
          </th>
          <td>
           <code class="literal">
            <a class="link" href="replication-options-binary-log.html#sysvar_binlog_group_commit_sync_no_delay_count">
             binlog_group_commit_sync_no_delay_count
            </a>
           </code>
          </td>
         </tr>
         <tr>
          <th>
           Scope
          </th>
          <td>
           Global
          </td>
         </tr>
         <tr>
          <th>
           Dynamic
          </th>
          <td>
           Yes
          </td>
         </tr>
         <tr>
          <th>
           <a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
            <code class="literal">
             SET_VAR
            </code>
           </a>
           Hint Applies
          </th>
          <td>
           No
          </td>
         </tr>
         <tr>
          <th>
           Type
          </th>
          <td>
           Integer
          </td>
         </tr>
         <tr>
          <th>
           Default Value
          </th>
          <td>
           <code class="literal">
            0
           </code>
          </td>
         </tr>
         <tr>
          <th>
           Minimum Value
          </th>
          <td>
           <code class="literal">
            0
           </code>
          </td>
         </tr>
         <tr>
          <th>
           Maximum Value
          </th>
          <td>
           <code class="literal">
            100000
           </code>
          </td>
         </tr>
        </tbody>
       </table>
      </div>
      <p>
       The maximum number of transactions to wait for before
            aborting the current delay as specified by
       <a class="link" href="replication-options-binary-log.html#sysvar_binlog_group_commit_sync_delay">
        <code class="literal">
         binlog_group_commit_sync_delay
        </code>
       </a>
       .
            If
       <a class="link" href="replication-options-binary-log.html#sysvar_binlog_group_commit_sync_delay">
        <code class="literal">
         binlog_group_commit_sync_delay
        </code>
       </a>
       is set to 0, then this option has no effect.
      </p>
     </li>
     <li class="listitem">
      <p>
       <a name="sysvar_binlog_max_flush_queue_time">
       </a>
       <a class="link" href="replication-options-binary-log.html#sysvar_binlog_max_flush_queue_time">
        <code class="literal">
         binlog_max_flush_queue_time
        </code>
       </a>
      </p>
      <a class="indexterm" name="idm46045140244960">
      </a>
      <a class="indexterm" name="idm46045140243856">
      </a>
      <div class="informaltable">
       <table frame="box" rules="all" summary="Properties for binlog_max_flush_queue_time">
        <colgroup>
         <col style="width: 30%"/>
         <col style="width: 70%"/>
        </colgroup>
        <tbody>
         <tr>
          <th>
           Command-Line Format
          </th>
          <td>
           <code class="literal">
            --binlog-max-flush-queue-time=#
           </code>
          </td>
         </tr>
         <tr>
          <th>
           Deprecated
          </th>
          <td>
           Yes
          </td>
         </tr>
         <tr>
          <th>
           System Variable
          </th>
          <td>
           <code class="literal">
            <a class="link" href="replication-options-binary-log.html#sysvar_binlog_max_flush_queue_time">
             binlog_max_flush_queue_time
            </a>
           </code>
          </td>
         </tr>
         <tr>
          <th>
           Scope
          </th>
          <td>
           Global
          </td>
         </tr>
         <tr>
          <th>
           Dynamic
          </th>
          <td>
           Yes
          </td>
         </tr>
         <tr>
          <th>
           <a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
            <code class="literal">
             SET_VAR
            </code>
           </a>
           Hint Applies
          </th>
          <td>
           No
          </td>
         </tr>
         <tr>
          <th>
           Type
          </th>
          <td>
           Integer
          </td>
         </tr>
         <tr>
          <th>
           Default Value
          </th>
          <td>
           <code class="literal">
            0
           </code>
          </td>
         </tr>
         <tr>
          <th>
           Minimum Value
          </th>
          <td>
           <code class="literal">
            0
           </code>
          </td>
         </tr>
         <tr>
          <th>
           Maximum Value
          </th>
          <td>
           <code class="literal">
            100000
           </code>
          </td>
         </tr>
         <tr>
          <th>
           Unit
          </th>
          <td>
           microseconds
          </td>
         </tr>
        </tbody>
       </table>
      </div>
      <p>
       <code class="literal">
        binlog_max_flush_queue_time
       </code>
       is
            deprecated, and is marked for eventual removal in a future
            MySQL release. Formerly, this system variable controlled the
            time in microseconds to continue reading transactions from
            the flush queue before proceeding with group commit. It no
            longer has any effect.
      </p>
     </li>
     <li class="listitem">
      <p>
       <a name="sysvar_binlog_order_commits">
       </a>
       <a class="link" href="replication-options-binary-log.html#sysvar_binlog_order_commits">
        <code class="literal">
         binlog_order_commits
        </code>
       </a>
      </p>
      <a class="indexterm" name="idm46045140209296">
      </a>
      <a class="indexterm" name="idm46045140208256">
      </a>
      <div class="informaltable">
       <table frame="box" rules="all" summary="Properties for binlog_order_commits">
        <colgroup>
         <col style="width: 30%"/>
         <col style="width: 70%"/>
        </colgroup>
        <tbody>
         <tr>
          <th>
           Command-Line Format
          </th>
          <td>
           <code class="literal">
            --binlog-order-commits[={OFF|ON}]
           </code>
          </td>
         </tr>
         <tr>
          <th>
           System Variable
          </th>
          <td>
           <code class="literal">
            <a class="link" href="replication-options-binary-log.html#sysvar_binlog_order_commits">
             binlog_order_commits
            </a>
           </code>
          </td>
         </tr>
         <tr>
          <th>
           Scope
          </th>
          <td>
           Global
          </td>
         </tr>
         <tr>
          <th>
           Dynamic
          </th>
          <td>
           Yes
          </td>
         </tr>
         <tr>
          <th>
           <a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
            <code class="literal">
             SET_VAR
            </code>
           </a>
           Hint Applies
          </th>
          <td>
           No
          </td>
         </tr>
         <tr>
          <th>
           Type
          </th>
          <td>
           Boolean
          </td>
         </tr>
         <tr>
          <th>
           Default Value
          </th>
          <td>
           <code class="literal">
            ON
           </code>
          </td>
         </tr>
        </tbody>
       </table>
      </div>
      <p>
       When this variable is enabled on a replication source server
            (which is the default), transaction commit instructions
            issued to storage engines are serialized on a single thread,
            so that transactions are always committed in the same order
            as they are written to the binary log. Disabling this
            variable permits transaction commit instructions to be
            issued using multiple threads. Used in combination with
            binary log group commit, this prevents the commit rate of a
            single transaction being a bottleneck to throughput, and
            might therefore produce a performance improvement.
      </p>
      <p>
       Transactions are written to the binary log at the point when
            all the storage engines involved have confirmed that the
            transaction is prepared to commit. The binary log group
            commit logic then commits a group of transactions after
            their binary log write has taken place. When
       <a class="link" href="replication-options-binary-log.html#sysvar_binlog_order_commits">
        <code class="literal">
         binlog_order_commits
        </code>
       </a>
       is
            disabled, because multiple threads are used for this
            process, transactions in a commit group might be committed
            in a different order from their order in the binary log.
            (Transactions from a single client always commit in
            chronological order.) In many cases this does not matter, as
            operations carried out in separate transactions should
            produce consistent results, and if that is not the case, a
            single transaction ought to be used instead.
      </p>
      <p>
       If you want to ensure that the transaction history on the
            source and on a multithreaded replica remains identical, set
       <a class="link" href="replication-options-replica.html#sysvar_replica_preserve_commit_order">
        <code class="literal">
         replica_preserve_commit_order=1
        </code>
       </a>
       on the replica.
      </p>
     </li>
     <li class="listitem">
      <p>
       <a name="sysvar_binlog_rotate_encryption_master_key_at_startup">
       </a>
       <a class="link" href="replication-options-binary-log.html#sysvar_binlog_rotate_encryption_master_key_at_startup">
        <code class="literal">
         binlog_rotate_encryption_master_key_at_startup
        </code>
       </a>
      </p>
      <a class="indexterm" name="idm46045140177856">
      </a>
      <a class="indexterm" name="idm46045140176736">
      </a>
      <div class="informaltable">
       <table frame="box" rules="all" summary="Properties for binlog_rotate_encryption_master_key_at_startup">
        <colgroup>
         <col style="width: 30%"/>
         <col style="width: 70%"/>
        </colgroup>
        <tbody>
         <tr>
          <th>
           Command-Line Format
          </th>
          <td>
           <code class="literal">
            --binlog-rotate-encryption-master-key-at-startup[={OFF|ON}]
           </code>
          </td>
         </tr>
         <tr>
          <th>
           System Variable
          </th>
          <td>
           <code class="literal">
            <a class="link" href="replication-options-binary-log.html#sysvar_binlog_rotate_encryption_master_key_at_startup">
             binlog_rotate_encryption_master_key_at_startup
            </a>
           </code>
          </td>
         </tr>
         <tr>
          <th>
           Scope
          </th>
          <td>
           Global
          </td>
         </tr>
         <tr>
          <th>
           Dynamic
          </th>
          <td>
           No
          </td>
         </tr>
         <tr>
          <th>
           <a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
            <code class="literal">
             SET_VAR
            </code>
           </a>
           Hint Applies
          </th>
          <td>
           No
          </td>
         </tr>
         <tr>
          <th>
           Type
          </th>
          <td>
           Boolean
          </td>
         </tr>
         <tr>
          <th>
           Default Value
          </th>
          <td>
           <code class="literal">
            OFF
           </code>
          </td>
         </tr>
        </tbody>
       </table>
      </div>
      <p>
       Specifies whether or not the binary log master key is
            rotated at server startup. The binary log master key is the
            binary log encryption key that is used to encrypt file
            passwords for the binary log files and relay log files on
            the server. When a server is started for the first time with
            binary log encryption enabled
            (
       <a class="link" href="replication-options-binary-log.html#sysvar_binlog_encryption">
        <code class="literal">
         binlog_encryption=ON
        </code>
       </a>
       ), a
            new binary log encryption key is generated and used as the
            binary log master key. If the
       <a class="link" href="replication-options-binary-log.html#sysvar_binlog_rotate_encryption_master_key_at_startup">
        <code class="literal">
         binlog_rotate_encryption_master_key_at_startup
        </code>
       </a>
       system variable is also set to
       <code class="literal">
        ON
       </code>
       ,
            whenever the server is restarted, a further binary log
            encryption key is generated and used as the binary log
            master key for all subsequent binary log files and relay log
            files. If the
       <a class="link" href="replication-options-binary-log.html#sysvar_binlog_rotate_encryption_master_key_at_startup">
        <code class="literal">
         binlog_rotate_encryption_master_key_at_startup
        </code>
       </a>
       system variable is set to
       <code class="literal">
        OFF
       </code>
       , which is
            the default, the existing binary log master key is used
            again after the server restarts. For more information on
            binary log encryption keys and the binary log master key,
            see
       <a class="xref" href="replication-binlog-encryption.html" title="19.3.2 Encrypting Binary Log Files and Relay Log Files">
        Section 19.3.2, “Encrypting Binary Log Files and Relay Log Files”
       </a>
       .
      </p>
     </li>
     <li class="listitem">
      <p>
       <a name="sysvar_binlog_row_event_max_size">
       </a>
       <a class="link" href="replication-options-binary-log.html#sysvar_binlog_row_event_max_size">
        <code class="literal">
         binlog_row_event_max_size
        </code>
       </a>
      </p>
      <a class="indexterm" name="idm46045140145120">
      </a>
      <a class="indexterm" name="idm46045140144016">
      </a>
      <div class="informaltable">
       <table frame="box" rules="all" summary="Properties for binlog-row-event-max-size">
        <colgroup>
         <col style="width: 30%"/>
         <col style="width: 70%"/>
        </colgroup>
        <tbody>
         <tr>
          <th>
           Command-Line Format
          </th>
          <td>
           <code class="literal">
            --binlog-row-event-max-size=#
           </code>
          </td>
         </tr>
         <tr>
          <th>
           System Variable
          </th>
          <td>
           <code class="literal">
            <a class="link" href="replication-options-binary-log.html#sysvar_binlog_row_event_max_size">
             binlog_row_event_max_size
            </a>
           </code>
          </td>
         </tr>
         <tr>
          <th>
           Scope
          </th>
          <td>
           Global
          </td>
         </tr>
         <tr>
          <th>
           Dynamic
          </th>
          <td>
           No
          </td>
         </tr>
         <tr>
          <th>
           <a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
            <code class="literal">
             SET_VAR
            </code>
           </a>
           Hint Applies
          </th>
          <td>
           No
          </td>
         </tr>
         <tr>
          <th>
           Type
          </th>
          <td>
           Integer
          </td>
         </tr>
         <tr>
          <th>
           Default Value
          </th>
          <td>
           <code class="literal">
            8192
           </code>
          </td>
         </tr>
         <tr>
          <th>
           Minimum Value
          </th>
          <td>
           <code class="literal">
            256
           </code>
          </td>
         </tr>
         <tr>
          <th>
           Maximum Value (64-bit platforms)
          </th>
          <td>
           <code class="literal">
            18446744073709551615
           </code>
          </td>
         </tr>
         <tr>
          <th>
           Maximum Value (32-bit platforms)
          </th>
          <td>
           <code class="literal">
            4294967295
           </code>
          </td>
         </tr>
         <tr>
          <th>
           Unit
          </th>
          <td>
           bytes
          </td>
         </tr>
        </tbody>
       </table>
      </div>
      <p>
       When row-based binary logging is used, this setting is a
            soft limit on the maximum size of a row-based binary log
            event, in bytes. Where possible, rows stored in the binary
            log are grouped into events with a size not exceeding the
            value of this setting. If an event cannot be split, the
            maximum size can be exceeded. The default is 8192 bytes.
      </p>
      <p>
       This global system variable is read-only and can be set only
            at server startup. Its value can therefore only be modified
            by using the
       <code class="literal">
        PERSIST_ONLY
       </code>
       keyword or the
       <code class="literal">
        @@persist_only
       </code>
       qualifier with the
       <a class="link" href="set.html" title="13.3.6 The SET Type">
        <code class="literal">
         SET
        </code>
       </a>
       statement.
      </p>
     </li>
     <li class="listitem">
      <p>
       <a name="sysvar_binlog_row_image">
       </a>
       <a class="link" href="replication-options-binary-log.html#sysvar_binlog_row_image">
        <code class="literal">
         binlog_row_image
        </code>
       </a>
      </p>
      <a class="indexterm" name="idm46045140106528">
      </a>
      <a class="indexterm" name="idm46045140105440">
      </a>
      <div class="informaltable">
       <table frame="box" rules="all" summary="Properties for binlog_row_image">
        <colgroup>
         <col style="width: 30%"/>
         <col style="width: 70%"/>
        </colgroup>
        <tbody>
         <tr>
          <th>
           Command-Line Format
          </th>
          <td>
           <code class="literal">
            --binlog-row-image=image_type
           </code>
          </td>
         </tr>
         <tr>
          <th>
           System Variable
          </th>
          <td>
           <code class="literal">
            <a class="link" href="replication-options-binary-log.html#sysvar_binlog_row_image">
             binlog_row_image
            </a>
           </code>
          </td>
         </tr>
         <tr>
          <th>
           Scope
          </th>
          <td>
           Global, Session
          </td>
         </tr>
         <tr>
          <th>
           Dynamic
          </th>
          <td>
           Yes
          </td>
         </tr>
         <tr>
          <th>
           <a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
            <code class="literal">
             SET_VAR
            </code>
           </a>
           Hint Applies
          </th>
          <td>
           No
          </td>
         </tr>
         <tr>
          <th>
           Type
          </th>
          <td>
           Enumeration
          </td>
         </tr>
         <tr>
          <th>
           Default Value
          </th>
          <td>
           <code class="literal">
            full
           </code>
          </td>
         </tr>
         <tr>
          <th>
           Valid Values
          </th>
          <td>
           <p class="valid-value">
            <code class="literal">
             full
            </code>
            (Log all columns)
           </p>
           <p class="valid-value">
            <code class="literal">
             minimal
            </code>
            (Log only changed columns, and columns needed to identify rows)
           </p>
           <p class="valid-value">
            <code class="literal">
             noblob
            </code>
            (Log all columns, except for unneeded BLOB and TEXT columns)
           </p>
          </td>
         </tr>
        </tbody>
       </table>
      </div>
      <p>
       For MySQL row-based replication, this variable determines
            how row images are written to the binary log.
      </p>
      <p>
       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
       <a class="xref" href="system-variable-privileges.html" title="7.1.9.1 System Variable Privileges">
        Section 7.1.9.1, “System Variable Privileges”
       </a>
       .
      </p>
      <p>
       In MySQL row-based replication, each row change event
            contains two images, a
       <span class="quote">
        “
        <span class="quote">
         before
        </span>
        ”
       </span>
       image whose
            columns are matched against when searching for the row to be
            updated, and an
       <span class="quote">
        “
        <span class="quote">
         after
        </span>
        ”
       </span>
       image containing the
            changes. Normally, MySQL logs full rows (that is, all
            columns) for both the before and after images. However, it
            is not strictly necessary to include every column in both
            images, and we can often save disk, memory, and network
            usage by logging only those columns which are actually
            required.
      </p>
      <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
       <div class="admon-title">
        Note
       </div>
       <p>
        When deleting a row, only the before image is logged,
              since there are no changed values to propagate following
              the deletion. When inserting a row, only the after image
              is logged, since there is no existing row to be matched.
              Only when updating a row are both the before and after
              images required, and both written to the binary log.
       </p>
      </div>
      <p>
       For the before image, it is necessary only that the minimum
            set of columns required to uniquely identify rows is logged.
            If the table containing the row has a primary key, then only
            the primary key column or columns are written to the binary
            log. Otherwise, if the table has a unique key all of whose
            columns are
       <code class="literal">
        NOT NULL
       </code>
       , then only the
            columns in the unique key need be logged. (If the table has
            neither a primary key nor a unique key without any
       <code class="literal">
        NULL
       </code>
       columns, then all columns must be
            used in the before image, and logged.) In the after image,
            it is necessary to log only the columns which have actually
            changed.
      </p>
      <p>
       You can cause the server to log full or minimal rows using
            the
       <code class="literal">
        binlog_row_image
       </code>
       system variable.
            This variable actually takes one of three possible values,
            as shown in the following list:
      </p>
      <div class="itemizedlist">
       <ul class="itemizedlist" style="list-style-type: circle; ">
        <li class="listitem">
         <p>
          <code class="literal">
           full
          </code>
          : Log all columns in both the
                before image and the after image.
         </p>
        </li>
        <li class="listitem">
         <p>
          <code class="literal">
           minimal
          </code>
          : Log only those columns in
                the before image that are required to identify the row
                to be changed; log only those columns in the after image
                where a value was specified by the SQL statement, or
                generated by auto-increment.
         </p>
        </li>
        <li class="listitem">
         <p>
          <code class="literal">
           noblob
          </code>
          : Log all columns (same as
          <code class="literal">
           full
          </code>
          ), except for
          <a class="link" href="blob.html" title="13.3.4 The BLOB and TEXT Types">
           <code class="literal">
            BLOB
           </code>
          </a>
          and
          <a class="link" href="blob.html" title="13.3.4 The BLOB and TEXT Types">
           <code class="literal">
            TEXT
           </code>
          </a>
          columns that are not
                required to identify rows, or that have not changed.
         </p>
        </li>
       </ul>
      </div>
      <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
       <div class="admon-title">
        Note
       </div>
       <p>
        This variable is not supported by NDB Cluster; setting it
              has no effect on the logging of
        <a class="link" href="mysql-cluster.html" title="Chapter 25 MySQL NDB Cluster 8.4">
         <code class="literal">
          NDB
         </code>
        </a>
        tables.
       </p>
      </div>
      <p>
       The default value is
       <code class="literal">
        full
       </code>
       .
      </p>
      <p>
       When using
       <code class="literal">
        minimal
       </code>
       or
       <code class="literal">
        noblob
       </code>
       , deletes and updates are
            guaranteed to work correctly for a given table if and only
            if the following conditions are true for both the source and
            destination tables:
      </p>
      <div class="itemizedlist">
       <ul class="itemizedlist" style="list-style-type: circle; ">
        <li class="listitem">
         <p>
          All columns must be present and in the same order; each
                column must use the same data type as its counterpart in
                the other table.
         </p>
        </li>
        <li class="listitem">
         <p>
          The tables must have identical primary key definitions.
         </p>
        </li>
       </ul>
      </div>
      <p>
       (In other words, the tables must be identical with the
            possible exception of indexes that are not part of the
            tables' primary keys.)
      </p>
      <p>
       If these conditions are not met, it is possible that the
            primary key column values in the destination table may prove
            insufficient to provide a unique match for a delete or
            update. In this event, no warning or error is issued; the
            source and replica silently diverge, thus breaking
            consistency.
      </p>
      <p>
       Setting this variable has no effect when the binary logging
            format is
       <code class="literal">
        STATEMENT
       </code>
       . When
       <a class="link" href="replication-options-binary-log.html#sysvar_binlog_format">
        <code class="literal">
         binlog_format
        </code>
       </a>
       is
       <code class="literal">
        MIXED
       </code>
       , the setting for
       <code class="literal">
        binlog_row_image
       </code>
       is applied to changes
            that are logged using row-based format, but this setting has
            no effect on changes logged as statements.
      </p>
      <p>
       Setting
       <code class="literal">
        binlog_row_image
       </code>
       on either the
            global or session level does not cause an implicit commit;
            this means that this variable can be changed while a
            transaction is in progress without affecting the
            transaction.
      </p>
     </li>
     <li class="listitem">
      <p>
       <a name="sysvar_binlog_row_metadata">
       </a>
       <a class="link" href="replication-options-binary-log.html#sysvar_binlog_row_metadata">
        <code class="literal">
         binlog_row_metadata
        </code>
       </a>
      </p>
      <a class="indexterm" name="idm46045140044288">
      </a>
      <a class="indexterm" name="idm46045140043248">
      </a>
      <div class="informaltable">
       <table frame="box" rules="all" summary="Properties for binlog_row_metadata">
        <colgroup>
         <col style="width: 30%"/>
         <col style="width: 70%"/>
        </colgroup>
        <tbody>
         <tr>
          <th>
           Command-Line Format
          </th>
          <td>
           <code class="literal">
            --binlog-row-metadata=metadata_type
           </code>
          </td>
         </tr>
         <tr>
          <th>
           System Variable
          </th>
          <td>
           <code class="literal">
            <a class="link" href="replication-options-binary-log.html#sysvar_binlog_row_metadata">
             binlog_row_metadata
            </a>
           </code>
          </td>
         </tr>
         <tr>
          <th>
           Scope
          </th>
          <td>
           Global
          </td>
         </tr>
         <tr>
          <th>
           Dynamic
          </th>
          <td>
           Yes
          </td>
         </tr>
         <tr>
          <th>
           <a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
            <code class="literal">
             SET_VAR
            </code>
           </a>
           Hint Applies
          </th>
          <td>
           No
          </td>
         </tr>
         <tr>
          <th>
           Type
          </th>
          <td>
           Enumeration
          </td>
         </tr>
         <tr>
          <th>
           Default Value
          </th>
          <td>
           <code class="literal">
            MINIMAL
           </code>
          </td>
         </tr>
         <tr>
          <th>
           Valid Values
          </th>
          <td>
           <p class="valid-value">
            <code class="literal">
             FULL
            </code>
            (All metadata is included)
           </p>
           <p class="valid-value">
            <code class="literal">
             MINIMAL
            </code>
            (Limit included metadata)
           </p>
          </td>
         </tr>
        </tbody>
       </table>
      </div>
      <p>
       Configures the amount of table metadata added to the binary
            log when using row-based logging. When set to
       <code class="literal">
        MINIMAL
       </code>
       , the default, only metadata
            related to
       <code class="literal">
        SIGNED
       </code>
       flags, column character
            set and geometry types are logged. When set to
       <code class="literal">
        FULL
       </code>
       complete metadata for tables is
            logged, such as column name,
       <a class="link" href="enum.html" title="13.3.5 The ENUM Type">
        <code class="literal">
         ENUM
        </code>
       </a>
       or
       <code class="literal">
        SET
       </code>
       string values,
       <code class="literal">
        PRIMARY
            KEY
       </code>
       information, and so on.
      </p>
      <p>
       The extended metadata serves the following purposes:
      </p>
      <div class="itemizedlist">
       <ul class="itemizedlist" style="list-style-type: circle; ">
        <li class="listitem">
         <p>
          Replicas use the metadata to transfer data when its
                table structure is different from the source's.
         </p>
        </li>
        <li class="listitem">
         <p>
          External software can use the metadata to decode row
                events and store the data into external databases, such
                as a data warehouse.
         </p>
        </li>
       </ul>
      </div>
     </li>
     <li class="listitem">
      <p>
       <a name="sysvar_binlog_row_value_options">
       </a>
       <a class="link" href="replication-options-binary-log.html#sysvar_binlog_row_value_options">
        <code class="literal">
         binlog_row_value_options
        </code>
       </a>
      </p>
      <a class="indexterm" name="idm46045140006704">
      </a>
      <a class="indexterm" name="idm46045140005600">
      </a>
      <div class="informaltable">
       <table frame="box" rules="all" summary="Properties for binlog_row_value_options">
        <colgroup>
         <col style="width: 30%"/>
         <col style="width: 70%"/>
        </colgroup>
        <tbody>
         <tr>
          <th>
           Command-Line Format
          </th>
          <td>
           <code class="literal">
            --binlog-row-value-options=#
           </code>
          </td>
         </tr>
         <tr>
          <th>
           System Variable
          </th>
          <td>
           <code class="literal">
            <a class="link" href="replication-options-binary-log.html#sysvar_binlog_row_value_options">
             binlog_row_value_options
            </a>
           </code>
          </td>
         </tr>
         <tr>
          <th>
           Scope
          </th>
          <td>
           Global, Session
          </td>
         </tr>
         <tr>
          <th>
           Dynamic
          </th>
          <td>
           Yes
          </td>
         </tr>
         <tr>
          <th>
           <a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
            <code class="literal">
             SET_VAR
            </code>
           </a>
           Hint Applies
          </th>
          <td>
           No
          </td>
         </tr>
         <tr>
          <th>
           Type
          </th>
          <td>
           Set
          </td>
         </tr>
         <tr>
          <th>
           Default Value
          </th>
          <td>
           <code class="literal">
           </code>
          </td>
         </tr>
         <tr>
          <th>
           Valid Values
          </th>
          <td>
           <code class="literal">
            PARTIAL_JSON
           </code>
          </td>
         </tr>
        </tbody>
       </table>
      </div>
      <p>
       When set to
       <code class="literal">
        PARTIAL_JSON
       </code>
       , this enables
            use of a space-efficient binary log format for updates that
            modify only a small portion of a JSON document, which causes
            row-based replication to write only the modified parts of
            the JSON document to the after-image for the update in the
            binary log, rather than writing the full document (see
       <a class="xref" href="json.html#json-partial-updates" title="Partial Updates of JSON Values">
        Partial Updates of JSON Values
       </a>
       ). This works for an
       <a class="link" href="update.html" title="15.2.17 UPDATE Statement">
        <code class="literal">
         UPDATE
        </code>
       </a>
       statement which
            modifies a JSON column using any sequence of
       <a class="link" href="json-modification-functions.html#function_json-set">
        <code class="literal">
         JSON_SET()
        </code>
       </a>
       ,
       <a class="link" href="json-modification-functions.html#function_json-replace">
        <code class="literal">
         JSON_REPLACE()
        </code>
       </a>
       , and
       <a class="link" href="json-modification-functions.html#function_json-remove">
        <code class="literal">
         JSON_REMOVE()
        </code>
       </a>
       . If the server
            is unable to generate a partial update, the full document is
            used instead.
      </p>
      <p>
       The default value is an empty string, which disables use of
            the format. To unset
       <code class="literal">
        binlog_row_value_options
       </code>
       and revert to
            writing the full JSON document, set its value to the empty
            string.
      </p>
      <p>
       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
       <a class="xref" href="system-variable-privileges.html" title="7.1.9.1 System Variable Privileges">
        Section 7.1.9.1, “System Variable Privileges”
       </a>
       .
      </p>
      <p>
       <code class="literal">
        binlog_row_value_options=PARTIAL_JSON
       </code>
       takes effect only when binary logging is enabled and
       <a class="link" href="replication-options-binary-log.html#sysvar_binlog_format">
        <code class="literal">
         binlog_format
        </code>
       </a>
       is set to
       <code class="literal">
        ROW
       </code>
       or
       <code class="literal">
        MIXED
       </code>
       .
            Statement-based replication
       <span class="emphasis">
        <em>
         always
        </em>
       </span>
       logs
            only the modified parts of the JSON document, regardless of
            any value set for
       <code class="literal">
        binlog_row_value_options
       </code>
       . To maximize the
            amount of space saved, use
       <a class="link" href="replication-options-binary-log.html#sysvar_binlog_row_image">
        <code class="literal">
         binlog_row_image=NOBLOB
        </code>
       </a>
       or
       <code class="literal">
        binlog_row_image=MINIMAL
       </code>
       together with
            this option.
       <code class="literal">
        binlog_row_image=FULL
       </code>
       saves
            less space than either of these, since the full JSON
            document is stored in the before-image, and the partial
            update is stored only in the after-image.
      </p>
      <p>
       <a class="link" href="mysqlbinlog.html" title="6.6.9 mysqlbinlog — Utility for Processing Binary Log Files">
        <span class="command">
         <strong>
          mysqlbinlog
         </strong>
        </span>
       </a>
       output includes partial JSON
            updates in the form of events encoded as base-64 strings
            using
       <a class="link" href="binlog.html" title="15.7.8.1 BINLOG Statement">
        <code class="literal">
         BINLOG
        </code>
       </a>
       statements. If
            the
       <a class="link" href="mysqlbinlog.html#option_mysqlbinlog_verbose">
        <code class="option">
         --verbose
        </code>
       </a>
       option is
            specified,
       <a class="link" href="mysqlbinlog.html" title="6.6.9 mysqlbinlog — Utility for Processing Binary Log Files">
        <span class="command">
         <strong>
          mysqlbinlog
         </strong>
        </span>
       </a>
       displays the
            partial JSON updates as readable JSON using pseudo-SQL
            statements.
      </p>
      <p>
       MySQL Replication generates an error if a modification
            cannot be applied to the JSON document on the replica. This
            includes a failure to find the path. Be aware that, even
            with this and other safety checks, if a JSON document on a
            replica has diverged from that on the source and a partial
            update is applied, it remains theoretically possible to
            produce a valid but unexpected JSON document on the replica.
      </p>
     </li>
     <li class="listitem">
      <p>
       <a name="sysvar_binlog_rows_query_log_events">
       </a>
       <code class="literal">
        binlog_rows_query_log_events
       </code>
      </p>
      <a class="indexterm" name="idm46045139954656">
      </a>
      <a class="indexterm" name="idm46045139953552">
      </a>
      <div class="informaltable">
       <table frame="box" rules="all" summary="Properties for binlog_rows_query_log_events">
        <colgroup>
         <col style="width: 30%"/>
         <col style="width: 70%"/>
        </colgroup>
        <tbody>
         <tr>
          <th>
           Command-Line Format
          </th>
          <td>
           <code class="literal">
            --binlog-rows-query-log-events[={OFF|ON}]
           </code>
          </td>
         </tr>
         <tr>
          <th>
           System Variable
          </th>
          <td>
           <code class="literal">
            <a class="link" href="replication-options-binary-log.html#sysvar_binlog_rows_query_log_events">
             binlog_rows_query_log_events
            </a>
           </code>
          </td>
         </tr>
         <tr>
          <th>
           Scope
          </th>
          <td>
           Global, Session
          </td>
         </tr>
         <tr>
          <th>
           Dynamic
          </th>
          <td>
           Yes
          </td>
         </tr>
         <tr>
          <th>
           <a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
            <code class="literal">
             SET_VAR
            </code>
           </a>
           Hint Applies
          </th>
          <td>
           No
          </td>
         </tr>
         <tr>
          <th>
           Type
          </th>
          <td>
           Boolean
          </td>
         </tr>
         <tr>
          <th>
           Default Value
          </th>
          <td>
           <code class="literal">
            OFF
           </code>
          </td>
         </tr>
        </tbody>
       </table>
      </div>
      <p>
       This system variable affects row-based logging only. When
            enabled, it causes the server to write informational log
            events such as row query log events into its binary log.
            This information can be used for debugging and related
            purposes, such as obtaining the original query issued on the
            source when it cannot be reconstructed from the row updates.
      </p>
      <p>
       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
       <a class="xref" href="system-variable-privileges.html" title="7.1.9.1 System Variable Privileges">
        Section 7.1.9.1, “System Variable Privileges”
       </a>
       .
      </p>
      <p>
       These informational events are normally ignored by MySQL
            programs reading the binary log and so cause no issues when
            replicating or restoring from backup. To view them, increase
            the verbosity level by using mysqlbinlog's
       <a class="link" href="mysqlbinlog.html#option_mysqlbinlog_verbose">
        <code class="option">
         --verbose
        </code>
       </a>
       option twice,
            either as
       <code class="option">
        -vv
       </code>
       or
       <code class="option">
        --verbose
            --verbose
       </code>
       .
      </p>
     </li>
     <li class="listitem">
      <p>
       <a name="sysvar_binlog_stmt_cache_size">
       </a>
       <a class="link" href="replication-options-binary-log.html#sysvar_binlog_stmt_cache_size">
        <code class="literal">
         binlog_stmt_cache_size
        </code>
       </a>
      </p>
      <a class="indexterm" name="idm46045139924608">
      </a>
      <a class="indexterm" name="idm46045139923568">
      </a>
      <div class="informaltable">
       <table frame="box" rules="all" summary="Properties for binlog_stmt_cache_size">
        <colgroup>
         <col style="width: 30%"/>
         <col style="width: 70%"/>
        </colgroup>
        <tbody>
         <tr>
          <th>
           Command-Line Format
          </th>
          <td>
           <code class="literal">
            --binlog-stmt-cache-size=#
           </code>
          </td>
         </tr>
         <tr>
          <th>
           System Variable
          </th>
          <td>
           <code class="literal">
            <a class="link" href="replication-options-binary-log.html#sysvar_binlog_stmt_cache_size">
             binlog_stmt_cache_size
            </a>
           </code>
          </td>
         </tr>
         <tr>
          <th>
           Scope
          </th>
          <td>
           Global
          </td>
         </tr>
         <tr>
          <th>
           Dynamic
          </th>
          <td>
           Yes
          </td>
         </tr>
         <tr>
          <th>
           <a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
            <code class="literal">
             SET_VAR
            </code>
           </a>
           Hint Applies
          </th>
          <td>
           No
          </td>
         </tr>
         <tr>
          <th>
           Type
          </th>
          <td>
           Integer
          </td>
         </tr>
         <tr>
          <th>
           Default Value
          </th>
          <td>
           <code class="literal">
            32768
           </code>
          </td>
         </tr>
         <tr>
          <th>
           Minimum Value
          </th>
          <td>
           <code class="literal">
            4096
           </code>
          </td>
         </tr>
         <tr>
          <th>
           Maximum Value (64-bit platforms)
          </th>
          <td>
           <code class="literal">
            18446744073709547520
           </code>
          </td>
         </tr>
         <tr>
          <th>
           Maximum Value (32-bit platforms)
          </th>
          <td>
           <code class="literal">
            4294963200
           </code>
          </td>
         </tr>
         <tr>
          <th>
           Unit
          </th>
          <td>
           bytes
          </td>
         </tr>
         <tr>
          <th>
           <a class="link" href="server-system-variables.html#system-variables-block-size" title="Note">
            Block Size
           </a>
          </th>
          <td>
           <code class="literal">
            4096
           </code>
          </td>
         </tr>
        </tbody>
       </table>
      </div>
      <p>
       The size of the memory buffer for the binary log to hold
            nontransactional statements issued during a transaction.
      </p>
      <p>
       When binary logging is enabled on the server (with the
       <a class="link" href="replication-options-binary-log.html#sysvar_log_bin">
        <code class="literal">
         log_bin
        </code>
       </a>
       system variable set
            to ON), separate binary log transaction and statement caches
            are allocated for each client if the server supports any
            transactional storage engines. If the data for the
            nontransactional statements used in the transaction exceeds
            the space in the memory buffer, the excess data is stored in
            a temporary file. When binary log encryption is active on
            the server, the memory buffer is not encrypted, but any
            temporary file used to hold the binary log cache is
            encrypted. After each transaction is committed, the binary
            log statement cache is reset by clearing the memory buffer
            and truncating the temporary file if used.
      </p>
      <p>
       If you often use large nontransactional statements during
            transactions, you can increase this cache size to get better
            performance by reducing or eliminating the need to write to
            temporary files. The
       <a class="link" href="server-status-variables.html#statvar_Binlog_stmt_cache_use">
        <code class="literal">
         Binlog_stmt_cache_use
        </code>
       </a>
       and
       <a class="link" href="server-status-variables.html#statvar_Binlog_stmt_cache_disk_use">
        <code class="literal">
         Binlog_stmt_cache_disk_use
        </code>
       </a>
       status variables can be useful for tuning the size of this
            variable. See
       <a class="xref" href="binary-log.html" title="7.4.4 The Binary Log">
        Section 7.4.4, “The Binary Log”
       </a>
       .
      </p>
      <p>
       The
       <a class="link" href="replication-options-binary-log.html#sysvar_binlog_cache_size">
        <code class="literal">
         binlog_cache_size
        </code>
       </a>
       system variable sets the size for the transaction cache.
      </p>
     </li>
     <li class="listitem">
      <p>
       <a name="sysvar_binlog_transaction_compression">
       </a>
       <a class="link" href="replication-options-binary-log.html#sysvar_binlog_transaction_compression">
        <code class="literal">
         binlog_transaction_compression
        </code>
       </a>
      </p>
      <a class="indexterm" name="idm46045139877504">
      </a>
      <a class="indexterm" name="idm46045139876400">
      </a>
      <div class="informaltable">
       <table frame="box" rules="all" summary="Properties for binlog_transaction_compression">
        <colgroup>
         <col style="width: 30%"/>
         <col style="width: 70%"/>
        </colgroup>
        <tbody>
         <tr>
          <th>
           Command-Line Format
          </th>
          <td>
           <code class="literal">
            --binlog-transaction-compression[={OFF|ON}]
           </code>
          </td>
         </tr>
         <tr>
          <th>
           System Variable
          </th>
          <td>
           <code class="literal">
            <a class="link" href="replication-options-binary-log.html#sysvar_binlog_transaction_compression">
             binlog_transaction_compression
            </a>
           </code>
          </td>
         </tr>
         <tr>
          <th>
           Scope
          </th>
          <td>
           Global, Session
          </td>
         </tr>
         <tr>
          <th>
           Dynamic
          </th>
          <td>
           Yes
          </td>
         </tr>
         <tr>
          <th>
           <a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
            <code class="literal">
             SET_VAR
            </code>
           </a>
           Hint Applies
          </th>
          <td>
           No
          </td>
         </tr>
         <tr>
          <th>
           Type
          </th>
          <td>
           Boolean
          </td>
         </tr>
         <tr>
          <th>
           Default Value
          </th>
          <td>
           <code class="literal">
            OFF
           </code>
          </td>
         </tr>
        </tbody>
       </table>
      </div>
      <p>
       Enables compression for transactions that are written to
            binary log files on this server.
       <code class="literal">
        OFF
       </code>
       is
            the default. Use the
       <a class="link" href="replication-options-binary-log.html#sysvar_binlog_transaction_compression_level_zstd">
        <code class="literal">
         binlog_transaction_compression_level_zstd
        </code>
       </a>
       system variable to set the level for the
       <code class="literal">
        zstd
       </code>
       algorithm that is used for
            compression.
      </p>
      <p>
       Setting
       <a class="link" href="replication-options-binary-log.html#sysvar_binlog_transaction_compression">
        <code class="literal">
         binlog_transaction_compression
        </code>
       </a>
       has no immediate effect but rather applies to all subsequent
       <a class="link" href="start-replica.html" title="15.4.2.4 START REPLICA Statement">
        <code class="literal">
         START REPLICA
        </code>
       </a>
       statements.
      </p>
      <p>
       When binary log transaction compression is enabled,
            transaction payloads are compressed and then written to the
            binary log file as a single event
            (
       <code class="literal">
        Transaction_payload_event
       </code>
       ). Compressed
            transaction payloads remain in a compressed state while they
            are sent in the replication stream to replicas, other Group
            Replication group members, or clients such as
       <a class="link" href="mysqlbinlog.html" title="6.6.9 mysqlbinlog — Utility for Processing Binary Log Files">
        <span class="command">
         <strong>
          mysqlbinlog
         </strong>
        </span>
       </a>
       , and are written to the relay
            log still in their compressed state. Binary log transaction
            compression therefore saves storage space both on the
            originator of the transaction and on the recipient (and for
            their backups), and saves network bandwidth when the
            transactions are sent between server instances.
      </p>
      <p>
       For
       <code class="literal">
        binlog_transaction_compression=ON
       </code>
       to
            have a direct effect, binary logging must be enabled on the
            server. When a MySQL 8.4 server instance has no
            binary log, it can receive, handle, and display compressed
            transaction payloads regardless of its value for
       <a class="link" href="replication-options-binary-log.html#sysvar_binlog_transaction_compression">
        <code class="literal">
         binlog_transaction_compression
        </code>
       </a>
       .
            Compressed transaction payloads received by such server
            instances are written in their compressed state to the relay
            log, so they benefit indirectly from compression carried out
            by other servers in the replication topology.
      </p>
      <p>
       This system variable cannot be changed within the context of
            a transaction. 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
       <a class="xref" href="system-variable-privileges.html" title="7.1.9.1 System Variable Privileges">
        Section 7.1.9.1, “System Variable Privileges”
       </a>
       .
      </p>
      <p>
       For more information on binary log transaction compression,
            including details of what events are and are not compressed,
            and changes in behavior when transaction compression is in
            use, see
       <a class="xref" href="binary-log-transaction-compression.html" title="7.4.4.5 Binary Log Transaction Compression">
        Section 7.4.4.5, “Binary Log Transaction Compression”
       </a>
       .
      </p>
      <p>
       You can use the
       <a class="link" href="mysql-cluster-options-variables.html#sysvar_ndb_log_transaction_compression">
        <code class="literal">
         ndb_log_transaction_compression
        </code>
       </a>
       system variable to enable this feature for
       <a class="link" href="mysql-cluster.html" title="Chapter 25 MySQL NDB Cluster 8.4">
        <code class="literal">
         NDB
        </code>
       </a>
       . In addition, setting
       <code class="option">
        --binlog-transaction-compression=ON
       </code>
       on the
            command line or in a
       <code class="filename">
        my.cnf
       </code>
       file causes
       <code class="literal">
        ndb_log_transaction_compression
       </code>
       to be
            enabled on server startup. See the description of the
            variable for further information.
      </p>
     </li>
     <li class="listitem">
      <p>
       <a name="sysvar_binlog_transaction_compression_level_zstd">
       </a>
       <a class="link" href="replication-options-binary-log.html#sysvar_binlog_transaction_compression_level_zstd">
        <code class="literal">
         binlog_transaction_compression_level_zstd
        </code>
       </a>
      </p>
      <a class="indexterm" name="idm46045139831872">
      </a>
      <a class="indexterm" name="idm46045139830752">
      </a>
      <div class="informaltable">
       <table frame="box" rules="all" summary="Properties for binlog_transaction_compression_level_zstd">
        <colgroup>
         <col style="width: 30%"/>
         <col style="width: 70%"/>
        </colgroup>
        <tbody>
         <tr>
          <th>
           Command-Line Format
          </th>
          <td>
           <code class="literal">
            --binlog-transaction-compression-level-zstd=#
           </code>
          </td>
         </tr>
         <tr>
          <th>
           System Variable
          </th>
          <td>
           <code class="literal">
            <a class="link" href="replication-options-binary-log.html#sysvar_binlog_transaction_compression_level_zstd">
             binlog_transaction_compression_level_zstd
            </a>
           </code>
          </td>
         </tr>
         <tr>
          <th>
           Scope
          </th>
          <td>
           Global, Session
          </td>
         </tr>
         <tr>
          <th>
           Dynamic
          </th>
          <td>
           Yes
          </td>
         </tr>
         <tr>
          <th>
           <a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
            <code class="literal">
             SET_VAR
            </code>
           </a>
           Hint Applies
          </th>
          <td>
           No
          </td>
         </tr>
         <tr>
          <th>
           Type
          </th>
          <td>
           Integer
          </td>
         </tr>
         <tr>
          <th>
           Default Value
          </th>
          <td>
           <code class="literal">
            3
           </code>
          </td>
         </tr>
         <tr>
          <th>
           Minimum Value
          </th>
          <td>
           <code class="literal">
            1
           </code>
          </td>
         </tr>
         <tr>
          <th>
           Maximum Value
          </th>
          <td>
           <code class="literal">
            22
           </code>
          </td>
         </tr>
        </tbody>
       </table>
      </div>
      <p>
       Sets the compression level for binary log transaction
            compression on this server, which is enabled by the
       <a class="link" href="replication-options-binary-log.html#sysvar_binlog_transaction_compression">
        <code class="literal">
         binlog_transaction_compression
        </code>
       </a>
       system variable. The value is an integer that determines the
            compression effort, from 1 (the lowest effort) to 22 (the
            highest effort). If you do not specify this system variable,
            the compression level is set to 3.
      </p>
      <p>
       Setting
       <a class="link" href="replication-options-binary-log.html#sysvar_binlog_transaction_compression_level_zstd">
        <code class="literal">
         binlog_transaction_compression_level_zstd
        </code>
       </a>
       has no immediate effect but rather applies to all subsequent
       <a class="link" href="start-replica.html" title="15.4.2.4 START REPLICA Statement">
        <code class="literal">
         START REPLICA
        </code>
       </a>
       statements.
      </p>
      <p>
       As the compression level increases, the data compression
            ratio increases, which reduces the storage space and network
            bandwidth required for the transaction payload. However, the
            effort required for data compression also increases, taking
            time and CPU and memory resources on the originating server.
            Increases in the compression effort do not have a linear
            relationship to increases in the data compression ratio.
      </p>
      <p>
       This system variable cannot be changed within the context of
            a transaction. 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
       <a class="xref" href="system-variable-privileges.html" title="7.1.9.1 System Variable Privileges">
        Section 7.1.9.1, “System Variable Privileges”
       </a>
       .
      </p>
      <p>
       This variable has no effect on logging of transactions on
       <a class="link" href="mysql-cluster.html" title="Chapter 25 MySQL NDB Cluster 8.4">
        <code class="literal">
         NDB
        </code>
       </a>
       tables; use
       <a class="link" href="mysql-cluster-options-variables.html#sysvar_ndb_log_transaction_compression_level_zstd">
        <code class="literal">
         ndb_log_transaction_compression_level_zstd
        </code>
       </a>
       instead.
      </p>
     </li>
     <li class="listitem">
      <p>
       <a name="sysvar_binlog_transaction_dependency_history_size">
       </a>
       <a class="link" href="replication-options-binary-log.html#sysvar_binlog_transaction_dependency_history_size">
        <code class="literal">
         binlog_transaction_dependency_history_size
        </code>
       </a>
      </p>
      <a class="indexterm" name="idm46045139791152">
      </a>
      <a class="indexterm" name="idm46045139790032">
      </a>
      <div class="informaltable">
       <table frame="box" rules="all" summary="Properties for binlog_transaction_dependency_history_size">
        <colgroup>
         <col style="width: 30%"/>
         <col style="width: 70%"/>
        </colgroup>
        <tbody>
         <tr>
          <th>
           Command-Line Format
          </th>
          <td>
           <code class="literal">
            --binlog-transaction-dependency-history-size=#
           </code>
          </td>
         </tr>
         <tr>
          <th>
           System Variable
          </th>
          <td>
           <code class="literal">
            <a class="link" href="replication-options-binary-log.html#sysvar_binlog_transaction_dependency_history_size">
             binlog_transaction_dependency_history_size
            </a>
           </code>
          </td>
         </tr>
         <tr>
          <th>
           Scope
          </th>
          <td>
           Global
          </td>
         </tr>
         <tr>
          <th>
           Dynamic
          </th>
          <td>
           Yes
          </td>
         </tr>
         <tr>
          <th>
           <a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
            <code class="literal">
             SET_VAR
            </code>
           </a>
           Hint Applies
          </th>
          <td>
           No
          </td>
         </tr>
         <tr>
          <th>
           Type
          </th>
          <td>
           Integer
          </td>
         </tr>
         <tr>
          <th>
           Default Value
          </th>
          <td>
           <code class="literal">
            25000
           </code>
          </td>
         </tr>
         <tr>
          <th>
           Minimum Value
          </th>
          <td>
           <code class="literal">
            1
           </code>
          </td>
         </tr>
         <tr>
          <th>
           Maximum Value
          </th>
          <td>
           <code class="literal">
            1000000
           </code>
          </td>
         </tr>
        </tbody>
       </table>
      </div>
      <p>
       Sets an upper limit on the number of row hashes which are
            kept in memory and used for looking up the transaction that
            last modified a given row. Once this number of hashes has
            been reached, the history is purged.
      </p>
     </li>
     <li class="listitem">
      <p>
       <a name="sysvar_log_bin">
       </a>
       <a class="link" href="replication-options-binary-log.html#sysvar_log_bin">
        <code class="literal">
         log_bin
        </code>
       </a>
      </p>
      <a class="indexterm" name="idm46045139760352">
      </a>
      <a class="indexterm" name="idm46045139759280">
      </a>
      <div class="informaltable">
       <table frame="box" rules="all" summary="Properties for log_bin">
        <colgroup>
         <col style="width: 30%"/>
         <col style="width: 70%"/>
        </colgroup>
        <tbody>
         <tr>
          <th>
           System Variable
          </th>
          <td>
           <code class="literal">
            <a class="link" href="replication-options-binary-log.html#sysvar_log_bin">
             log_bin
            </a>
           </code>
          </td>
         </tr>
         <tr>
          <th>
           Scope
          </th>
          <td>
           Global
          </td>
         </tr>
         <tr>
          <th>
           Dynamic
          </th>
          <td>
           No
          </td>
         </tr>
         <tr>
          <th>
           <a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
            <code class="literal">
             SET_VAR
            </code>
           </a>
           Hint Applies
          </th>
          <td>
           No
          </td>
         </tr>
         <tr>
          <th>
           Type
          </th>
          <td>
           Boolean
          </td>
         </tr>
        </tbody>
       </table>
      </div>
      <p>
       Shows the status of binary logging on the server, either
            enabled (
       <code class="literal">
        ON
       </code>
       ) or disabled
            (
       <code class="literal">
        OFF
       </code>
       ). With binary logging enabled, the
            server logs all statements that change data to the binary
            log, which is used for backup and replication.
       <code class="literal">
        ON
       </code>
       means that the binary log is
            available,
       <code class="literal">
        OFF
       </code>
       means that it is not in
            use. The
       <a class="link" href="replication-options-binary-log.html#option_mysqld_log-bin">
        <code class="option">
         --log-bin
        </code>
       </a>
       option can
            be used to specify a base name and location for the binary
            log.
      </p>
      <p>
       In earlier MySQL versions, binary logging was disabled by
            default, and was enabled if you specified the
       <code class="option">
        --log-bin
       </code>
       option. Binary logging is enabled
            by default, with the
       <code class="literal">
        log_bin
       </code>
       system
            variable set to
       <code class="literal">
        ON
       </code>
       , whether or not you
            specify the
       <code class="option">
        --log-bin
       </code>
       option. The exception
            is if you use
       <a class="link" href="mysqld.html" title="6.3.1 mysqld — The MySQL Server">
        <span class="command">
         <strong>
          mysqld
         </strong>
        </span>
       </a>
       to initialize the
            data directory manually by invoking it with the
       <code class="option">
        --initialize
       </code>
       or
       <code class="option">
        --initialize-insecure
       </code>
       option, when binary
            logging is disabled by default. It is possible to enable
            binary logging in this case by specifying the
       <code class="option">
        --log-bin
       </code>
       option.
      </p>
      <p>
       If the
       <a class="link" href="replication-options-binary-log.html#option_mysqld_log-bin">
        <code class="option">
         --skip-log-bin
        </code>
       </a>
       or
       <a class="link" href="replication-options-binary-log.html#option_mysqld_log-bin">
        <code class="option">
         --disable-log-bin
        </code>
       </a>
       option is specified at startup, binary logging is disabled,
            with the
       <code class="literal">
        log_bin
       </code>
       system variable set to
       <code class="literal">
        OFF
       </code>
       . If either of these options is
            specified and
       <code class="option">
        --log-bin
       </code>
       is also specified,
            the option specified later takes precedence.
      </p>
      <p>
       For information on the format and management of the binary
            log, see
       <a class="xref" href="binary-log.html" title="7.4.4 The Binary Log">
        Section 7.4.4, “The Binary Log”
       </a>
       .
      </p>
     </li>
     <li class="listitem">
      <p>
       <a name="sysvar_log_bin_basename">
       </a>
       <a class="link" href="replication-options-binary-log.html#sysvar_log_bin_basename">
        <code class="literal">
         log_bin_basename
        </code>
       </a>
      </p>
      <a class="indexterm" name="idm46045139724320">
      </a>
      <a class="indexterm" name="idm46045139723232">
      </a>
      <div class="informaltable">
       <table frame="box" rules="all" summary="Properties for log_bin_basename">
        <colgroup>
         <col style="width: 30%"/>
         <col style="width: 70%"/>
        </colgroup>
        <tbody>
         <tr>
          <th>
           System Variable
          </th>
          <td>
           <code class="literal">
            <a class="link" href="replication-options-binary-log.html#sysvar_log_bin_basename">
             log_bin_basename
            </a>
           </code>
          </td>
         </tr>
         <tr>
          <th>
           Scope
          </th>
          <td>
           Global
          </td>
         </tr>
         <tr>
          <th>
           Dynamic
          </th>
          <td>
           No
          </td>
         </tr>
         <tr>
          <th>
           <a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
            <code class="literal">
             SET_VAR
            </code>
           </a>
           Hint Applies
          </th>
          <td>
           No
          </td>
         </tr>
         <tr>
          <th>
           Type
          </th>
          <td>
           File name
          </td>
         </tr>
        </tbody>
       </table>
      </div>
      <p>
       Holds the base name and path for the binary log files, which
            can be set with the
       <a class="link" href="replication-options-binary-log.html#option_mysqld_log-bin">
        <code class="option">
         --log-bin
        </code>
       </a>
       server option. The maximum variable length is 256. In MySQL
            8.4, if the
       <code class="option">
        --log-bin
       </code>
       option
            is not supplied, the default base name is
       <code class="filename">
        binlog
       </code>
       . For compatibility with MySQL
            5.7, if the
       <code class="option">
        --log-bin
       </code>
       option is supplied
            with no string or with an empty string, the default base
            name is
       <code class="filename">
        <em class="replaceable">
         <code>
          host_name
         </code>
        </em>
        -bin
       </code>
       ,
            using the name of the host machine. The default location is
            the data directory.
      </p>
     </li>
     <li class="listitem">
      <p>
       <a name="sysvar_log_bin_index">
       </a>
       <a class="link" href="replication-options-binary-log.html#sysvar_log_bin_index">
        <code class="literal">
         log_bin_index
        </code>
       </a>
      </p>
      <a class="indexterm" name="idm46045139699168">
      </a>
      <a class="indexterm" name="idm46045139698080">
      </a>
      <div class="informaltable">
       <table frame="box" rules="all" summary="Properties for log-bin-index">
        <colgroup>
         <col style="width: 30%"/>
         <col style="width: 70%"/>
        </colgroup>
        <tbody>
         <tr>
          <th>
           Command-Line Format
          </th>
          <td>
           <code class="literal">
            --log-bin-index=file_name
           </code>
          </td>
         </tr>
         <tr>
          <th>
           System Variable
          </th>
          <td>
           <code class="literal">
            <a class="link" href="replication-options-binary-log.html#sysvar_log_bin_index">
             log_bin_index
            </a>
           </code>
          </td>
         </tr>
         <tr>
          <th>
           Scope
          </th>
          <td>
           Global
          </td>
         </tr>
         <tr>
          <th>
           Dynamic
          </th>
          <td>
           No
          </td>
         </tr>
         <tr>
          <th>
           <a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
            <code class="literal">
             SET_VAR
            </code>
           </a>
           Hint Applies
          </th>
          <td>
           No
          </td>
         </tr>
         <tr>
          <th>
           Type
          </th>
          <td>
           File name
          </td>
         </tr>
        </tbody>
       </table>
      </div>
      <p>
       Holds the base name and path for the binary log index file,
            which can be set with the
       <a class="link" href="replication-options-binary-log.html#option_mysqld_log-bin-index">
        <code class="option">
         --log-bin-index
        </code>
       </a>
       server
            option. The maximum variable length is 256.
      </p>
     </li>
     <li class="listitem">
      <p>
       <a name="sysvar_log_bin_trust_function_creators">
       </a>
       <a class="link" href="replication-options-binary-log.html#sysvar_log_bin_trust_function_creators">
        <code class="literal">
         log_bin_trust_function_creators
        </code>
       </a>
      </p>
      <a class="indexterm" name="idm46045139674896">
      </a>
      <a class="indexterm" name="idm46045139673792">
      </a>
      <div class="informaltable">
       <table frame="box" rules="all" summary="Properties for log_bin_trust_function_creators">
        <colgroup>
         <col style="width: 30%"/>
         <col style="width: 70%"/>
        </colgroup>
        <tbody>
         <tr>
          <th>
           Command-Line Format
          </th>
          <td>
           <code class="literal">
            --log-bin-trust-function-creators[={OFF|ON}]
           </code>
          </td>
         </tr>
         <tr>
          <th>
           Deprecated
          </th>
          <td>
           Yes
          </td>
         </tr>
         <tr>
          <th>
           System Variable
          </th>
          <td>
           <code class="literal">
            <a class="link" href="replication-options-binary-log.html#sysvar_log_bin_trust_function_creators">
             log_bin_trust_function_creators
            </a>
           </code>
          </td>
         </tr>
         <tr>
          <th>
           Scope
          </th>
          <td>
           Global
          </td>
         </tr>
         <tr>
          <th>
           Dynamic
          </th>
          <td>
           Yes
          </td>
         </tr>
         <tr>
          <th>
           <a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
            <code class="literal">
             SET_VAR
            </code>
           </a>
           Hint Applies
          </th>
          <td>
           No
          </td>
         </tr>
         <tr>
          <th>
           Type
          </th>
          <td>
           Boolean
          </td>
         </tr>
         <tr>
          <th>
           Default Value
          </th>
          <td>
           <code class="literal">
            OFF
           </code>
          </td>
         </tr>
        </tbody>
       </table>
      </div>
      <p>
       This variable applies when binary logging is enabled. It
            controls whether stored function creators can be trusted not
            to create stored functions that may cause unsafe events to
            be written to the binary log. If set to 0 (the default),
            users are not permitted to create or alter stored functions
            unless they have the
       <a class="link" href="privileges-provided.html#priv_super">
        <code class="literal">
         SUPER
        </code>
       </a>
       privilege in addition to the
       <a class="link" href="privileges-provided.html#priv_create-routine">
        <code class="literal">
         CREATE
            ROUTINE
        </code>
       </a>
       or
       <a class="link" href="privileges-provided.html#priv_alter-routine">
        <code class="literal">
         ALTER
            ROUTINE
        </code>
       </a>
       privilege. A setting of 0 also enforces
            the restriction that a function must be declared with the
       <code class="literal">
        DETERMINISTIC
       </code>
       characteristic, or with the
       <code class="literal">
        READS SQL DATA
       </code>
       or
       <code class="literal">
        NO
            SQL
       </code>
       characteristic. If the variable is set to 1,
            MySQL does not enforce these restrictions on stored function
            creation. This variable also applies to trigger creation.
            See
       <a class="xref" href="stored-programs-logging.html" title="27.7 Stored Program Binary Logging">
        Section 27.7, “Stored Program Binary Logging”
       </a>
       .
      </p>
     </li>
     <li class="listitem">
      <p>
       <a name="sysvar_log_replica_updates">
       </a>
       <a class="link" href="replication-options-binary-log.html#sysvar_log_replica_updates">
        <code class="literal">
         log_replica_updates
        </code>
       </a>
      </p>
      <a class="indexterm" name="idm46045139639920">
      </a>
      <a class="indexterm" name="idm46045139638880">
      </a>
      <div class="informaltable">
       <table frame="box" rules="all" summary="Properties for log_replica_updates">
        <colgroup>
         <col style="width: 30%"/>
         <col style="width: 70%"/>
        </colgroup>
        <tbody>
         <tr>
          <th>
           Command-Line Format
          </th>
          <td>
           <code class="literal">
            --log-replica-updates[={OFF|ON}]
           </code>
          </td>
         </tr>
         <tr>
          <th>
           System Variable
          </th>
          <td>
           <code class="literal">
            <a class="link" href="replication-options-binary-log.html#sysvar_log_replica_updates">
             log_replica_updates
            </a>
           </code>
          </td>
         </tr>
         <tr>
          <th>
           Scope
          </th>
          <td>
           Global
          </td>
         </tr>
         <tr>
          <th>
           Dynamic
          </th>
          <td>
           No
          </td>
         </tr>
         <tr>
          <th>
           <a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
            <code class="literal">
             SET_VAR
            </code>
           </a>
           Hint Applies
          </th>
          <td>
           No
          </td>
         </tr>
         <tr>
          <th>
           Type
          </th>
          <td>
           Boolean
          </td>
         </tr>
         <tr>
          <th>
           Default Value
          </th>
          <td>
           <code class="literal">
            ON
           </code>
          </td>
         </tr>
        </tbody>
       </table>
      </div>
      <p>
       <a class="link" href="replication-options-binary-log.html#sysvar_log_replica_updates">
        <code class="literal">
         log_replica_updates
        </code>
       </a>
       specifies whether updates received by a replica server from
            a replication source server should be logged to the
            replica's own binary log.
      </p>
      <p>
       Enabling this variable causes the replica to write the
            updates that are received from a source and performed by the
            replication SQL thread to the replica's own binary log.
            Binary logging, which is controlled by the
       <a class="link" href="replication-options-binary-log.html#option_mysqld_log-bin">
        <code class="option">
         --log-bin
        </code>
       </a>
       option and is
            enabled by default, must also be enabled on the replica for
            updates to be logged. See
       <a class="xref" href="replication-options.html" title="19.1.6 Replication and Binary Logging Options and Variables">
        Section 19.1.6, “Replication and Binary Logging Options and Variables”
       </a>
       .
       <a class="link" href="replication-options-binary-log.html#sysvar_log_replica_updates">
        <code class="literal">
         log_replica_updates
        </code>
       </a>
       is
            enabled by default, unless you specify
       <a class="link" href="replication-options-binary-log.html#option_mysqld_log-bin">
        <code class="option">
         --skip-log-bin
        </code>
       </a>
       to disable binary logging, in which case MySQL also disables
            replica update logging by default. If you need to disable
            replica update logging when binary logging is enabled,
            specify
       <a class="link" href="replication-options-binary-log.html#sysvar_log_replica_updates">
        <code class="option">
         --log-replica-updates=OFF
        </code>
       </a>
       at
            replica server startup.
      </p>
      <p>
       Enabling
       <a class="link" href="replication-options-binary-log.html#sysvar_log_replica_updates">
        <code class="literal">
         log_replica_updates
        </code>
       </a>
       enables
            replication servers to be chained. For example, you might
            want to set up replication servers using this arrangement:
      </p>
      <div class="copytoclipboard-wrapper">
       <pre class="programlisting one-line language-none"><div class="docs-select-all right" id="sa99277481"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-none">A -&gt; B -&gt; C</code></pre>
      </div>
      <p>
       Here,
       <code class="literal">
        A
       </code>
       serves as the source for the
            replica
       <code class="literal">
        B
       </code>
       , and
       <code class="literal">
        B
       </code>
       serves as the source for the replica
       <code class="literal">
        C
       </code>
       .
            For this to work,
       <code class="literal">
        B
       </code>
       must be both a source
       <span class="emphasis">
        <em>
         and
        </em>
       </span>
       a replica. With binary logging
            enabled and
       <a class="link" href="replication-options-binary-log.html#sysvar_log_replica_updates">
        <code class="literal">
         log_replica_updates
        </code>
       </a>
       enabled, which are the default settings, updates received
            from
       <code class="literal">
        A
       </code>
       are logged by
       <code class="literal">
        B
       </code>
       to its binary log, and can therefore be passed on to
       <code class="literal">
        C
       </code>
       .
      </p>
     </li>
     <li class="listitem">
      <p>
       <a name="sysvar_log_slave_updates">
       </a>
       <a class="link" href="replication-options-binary-log.html#sysvar_log_slave_updates">
        <code class="literal">
         log_slave_updates
        </code>
       </a>
      </p>
      <a class="indexterm" name="idm46045139596240">
      </a>
      <a class="indexterm" name="idm46045139595200">
      </a>
      <div class="informaltable">
       <table frame="box" rules="all" summary="Properties for log_slave_updates">
        <colgroup>
         <col style="width: 30%"/>
         <col style="width: 70%"/>
        </colgroup>
        <tbody>
         <tr>
          <th>
           Command-Line Format
          </th>
          <td>
           <code class="literal">
            --log-slave-updates[={OFF|ON}]
           </code>
          </td>
         </tr>
         <tr>
          <th>
           Deprecated
          </th>
          <td>
           Yes
          </td>
         </tr>
         <tr>
          <th>
           System Variable
          </th>
          <td>
           <code class="literal">
            <a class="link" href="replication-options-binary-log.html#sysvar_log_slave_updates">
             log_slave_updates
            </a>
           </code>
          </td>
         </tr>
         <tr>
          <th>
           Scope
          </th>
          <td>
           Global
          </td>
         </tr>
         <tr>
          <th>
           Dynamic
          </th>
          <td>
           No
          </td>
         </tr>
         <tr>
          <th>
           <a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
            <code class="literal">
             SET_VAR
            </code>
           </a>
           Hint Applies
          </th>
          <td>
           No
          </td>
         </tr>
         <tr>
          <th>
           Type
          </th>
          <td>
           Boolean
          </td>
         </tr>
         <tr>
          <th>
           Default Value
          </th>
          <td>
           <code class="literal">
            ON
           </code>
          </td>
         </tr>
        </tbody>
       </table>
      </div>
      <p>
       Deprecated alias for
       <a class="link" href="replication-options-binary-log.html#sysvar_log_replica_updates">
        <code class="literal">
         log_replica_updates
        </code>
       </a>
       .
      </p>
     </li>
     <li class="listitem">
      <p>
       <a name="sysvar_log_statements_unsafe_for_binlog">
       </a>
       <a class="link" href="replication-options-binary-log.html#sysvar_log_statements_unsafe_for_binlog">
        <code class="literal">
         log_statements_unsafe_for_binlog
        </code>
       </a>
      </p>
      <a class="indexterm" name="idm46045139567360">
      </a>
      <a class="indexterm" name="idm46045139566256">
      </a>
      <div class="informaltable">
       <table frame="box" rules="all" summary="Properties for log_statements_unsafe_for_binlog">
        <colgroup>
         <col style="width: 30%"/>
         <col style="width: 70%"/>
        </colgroup>
        <tbody>
         <tr>
          <th>
           Command-Line Format
          </th>
          <td>
           <code class="literal">
            --log-statements-unsafe-for-binlog[={OFF|ON}]
           </code>
          </td>
         </tr>
         <tr>
          <th>
           Deprecated
          </th>
          <td>
           Yes
          </td>
         </tr>
         <tr>
          <th>
           System Variable
          </th>
          <td>
           <code class="literal">
            <a class="link" href="replication-options-binary-log.html#sysvar_log_statements_unsafe_for_binlog">
             log_statements_unsafe_for_binlog
            </a>
           </code>
          </td>
         </tr>
         <tr>
          <th>
           Scope
          </th>
          <td>
           Global
          </td>
         </tr>
         <tr>
          <th>
           Dynamic
          </th>
          <td>
           Yes
          </td>
         </tr>
         <tr>
          <th>
           <a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
            <code class="literal">
             SET_VAR
            </code>
           </a>
           Hint Applies
          </th>
          <td>
           No
          </td>
         </tr>
         <tr>
          <th>
           Type
          </th>
          <td>
           Boolean
          </td>
         </tr>
         <tr>
          <th>
           Default Value
          </th>
          <td>
           <code class="literal">
            ON
           </code>
          </td>
         </tr>
        </tbody>
       </table>
      </div>
      <p>
       If error 1592 is encountered, controls whether the generated
            warnings are added to the error log or not.
      </p>
     </li>
     <li class="listitem">
      <p>
       <a name="sysvar_master_verify_checksum">
       </a>
       <a class="link" href="replication-options-binary-log.html#sysvar_master_verify_checksum">
        <code class="literal">
         master_verify_checksum
        </code>
       </a>
      </p>
      <a class="indexterm" name="idm46045139539552">
      </a>
      <a class="indexterm" name="idm46045139538512">
      </a>
      <div class="informaltable">
       <table frame="box" rules="all" summary="Properties for master_verify_checksum">
        <colgroup>
         <col style="width: 30%"/>
         <col style="width: 70%"/>
        </colgroup>
        <tbody>
         <tr>
          <th>
           Command-Line Format
          </th>
          <td>
           <code class="literal">
            --master-verify-checksum[={OFF|ON}]
           </code>
          </td>
         </tr>
         <tr>
          <th>
           Deprecated
          </th>
          <td>
           Yes
          </td>
         </tr>
         <tr>
          <th>
           System Variable
          </th>
          <td>
           <code class="literal">
            <a class="link" href="replication-options-binary-log.html#sysvar_master_verify_checksum">
             master_verify_checksum
            </a>
           </code>
          </td>
         </tr>
         <tr>
          <th>
           Scope
          </th>
          <td>
           Global
          </td>
         </tr>
         <tr>
          <th>
           Dynamic
          </th>
          <td>
           Yes
          </td>
         </tr>
         <tr>
          <th>
           <a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
            <code class="literal">
             SET_VAR
            </code>
           </a>
           Hint Applies
          </th>
          <td>
           No
          </td>
         </tr>
         <tr>
          <th>
           Type
          </th>
          <td>
           Boolean
          </td>
         </tr>
         <tr>
          <th>
           Default Value
          </th>
          <td>
           <code class="literal">
            OFF
           </code>
          </td>
         </tr>
        </tbody>
       </table>
      </div>
      <p>
       Deprecated alias for
       <a class="link" href="replication-options-binary-log.html#sysvar_source_verify_checksum">
        <code class="literal">
         source_verify_checksum
        </code>
       </a>
       .
      </p>
     </li>
     <li class="listitem">
      <p>
       <a name="sysvar_max_binlog_cache_size">
       </a>
       <a class="link" href="replication-options-binary-log.html#sysvar_max_binlog_cache_size">
        <code class="literal">
         max_binlog_cache_size
        </code>
       </a>
      </p>
      <a class="indexterm" name="idm46045139510704">
      </a>
      <a class="indexterm" name="idm46045139509664">
      </a>
      <div class="informaltable">
       <table frame="box" rules="all" summary="Properties for max_binlog_cache_size">
        <colgroup>
         <col style="width: 30%"/>
         <col style="width: 70%"/>
        </colgroup>
        <tbody>
         <tr>
          <th>
           Command-Line Format
          </th>
          <td>
           <code class="literal">
            --max-binlog-cache-size=#
           </code>
          </td>
         </tr>
         <tr>
          <th>
           System Variable
          </th>
          <td>
           <code class="literal">
            <a class="link" href="replication-options-binary-log.html#sysvar_max_binlog_cache_size">
             max_binlog_cache_size
            </a>
           </code>
          </td>
         </tr>
         <tr>
          <th>
           Scope
          </th>
          <td>
           Global
          </td>
         </tr>
         <tr>
          <th>
           Dynamic
          </th>
          <td>
           Yes
          </td>
         </tr>
         <tr>
          <th>
           <a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
            <code class="literal">
             SET_VAR
            </code>
           </a>
           Hint Applies
          </th>
          <td>
           No
          </td>
         </tr>
         <tr>
          <th>
           Type
          </th>
          <td>
           Integer
          </td>
         </tr>
         <tr>
          <th>
           Default Value (64-bit platforms)
          </th>
          <td>
           <code class="literal">
            18446744073709547520
           </code>
          </td>
         </tr>
         <tr>
          <th>
           Default Value (32-bit platforms)
          </th>
          <td>
           <code class="literal">
            4294967295
           </code>
          </td>
         </tr>
         <tr>
          <th>
           Minimum Value
          </th>
          <td>
           <code class="literal">
            4096
           </code>
          </td>
         </tr>
         <tr>
          <th>
           Maximum Value (64-bit platforms)
          </th>
          <td>
           <code class="literal">
            18446744073709547520
           </code>
          </td>
         </tr>
         <tr>
          <th>
           Maximum Value (32-bit platforms)
          </th>
          <td>
           <code class="literal">
            4294967295
           </code>
          </td>
         </tr>
         <tr>
          <th>
           Unit
          </th>
          <td>
           bytes
          </td>
         </tr>
         <tr>
          <th>
           <a class="link" href="server-system-variables.html#system-variables-block-size" title="Note">
            Block Size
           </a>
          </th>
          <td>
           <code class="literal">
            4096
           </code>
          </td>
         </tr>
        </tbody>
       </table>
      </div>
      <p>
       If a transaction requires more than this many bytes, the
            server generates a
       <span class="errortext">
        Multi-statement transaction
            required more than 'max_binlog_cache_size' bytes of
            storage
       </span>
       error. When
       <a class="link" href="replication-options-gtids.html#sysvar_gtid_mode">
        <code class="literal">
         gtid_mode
        </code>
       </a>
       is not
       <code class="literal">
        ON
       </code>
       , the maximum recommended value is 4GB,
            due to the fact that, in this case, MySQL cannot work with
            binary log positions greater than 4GB; when
       <code class="literal">
        gtid_mode
       </code>
       is
       <code class="literal">
        ON
       </code>
       , this
            limitation does not apply, and the server can work with
            binary log positions of arbitrary size.
      </p>
      <p>
       If, because
       <a class="link" href="replication-options-gtids.html#sysvar_gtid_mode">
        <code class="literal">
         gtid_mode
        </code>
       </a>
       is
            not
       <code class="literal">
        ON
       </code>
       , or for some other reason, you
            need to guarantee that the binary log does not exceed a
            given size
       <em class="replaceable">
        <code>
         maxsize
        </code>
       </em>
       , you should
            set this variable according to the formula shown here:
      </p>
      <div class="copytoclipboard-wrapper">
       <pre class="programlisting language-simple"><div class="docs-select-all right" id="sa68218065"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-simple">max_binlog_cache_size <span class="token operator">&lt;</span> 
  <span class="token punctuation">(</span><span class="token punctuation">(</span><span class="token punctuation">(</span><em class="replaceable">maxsize</em> <span class="token operator">-</span> max_binlog_size<span class="token punctuation">)</span> <span class="token operator">/</span> max_connections<span class="token punctuation">)</span> <span class="token operator">-</span> 1000<span class="token punctuation">)</span> <span class="token operator">/</span> 1<span class="token punctuation">.</span>2</code></pre>
      </div>
      <p>
       This calculation takes into account the following
            conditions:
      </p>
      <div class="itemizedlist">
       <ul class="itemizedlist" style="list-style-type: circle; ">
        <li class="listitem">
         <p>
          The server writes to the binary log as long as the size
                before it begins to write is less than
          <a class="link" href="replication-options-binary-log.html#sysvar_max_binlog_size">
           <code class="literal">
            max_binlog_size
           </code>
          </a>
          .
         </p>
        </li>
        <li class="listitem">
         <p>
          The server does not write single transactions, but
                rather groups of transactions. The maximum possible
                number of transactions in a group is equal to
          <a class="link" href="server-system-variables.html#sysvar_max_connections">
           <code class="literal">
            max_connections
           </code>
          </a>
          .
         </p>
        </li>
        <li class="listitem">
         <p>
          The server writes data that is not included in the
                cache. This includes a 4-byte checksum for each event;
                while this adds less than 20% to the transaction size,
                this amount is non-negible. In addition, the server
                writes a
          <code class="literal">
           Gtid_log_event
          </code>
          for each
                transaction; each of these events can add another 1 KB
                to what is written to the binary log.
         </p>
        </li>
       </ul>
      </div>
      <p>
       <code class="literal">
        max_binlog_cache_size
       </code>
       sets the size for
            the transaction cache only; the upper limit for the
            statement cache is governed by the
       <a class="link" href="replication-options-binary-log.html#sysvar_max_binlog_stmt_cache_size">
        <code class="literal">
         max_binlog_stmt_cache_size
        </code>
       </a>
       system variable.
      </p>
      <p>
       The visibility to sessions of
       <code class="literal">
        max_binlog_cache_size
       </code>
       matches that of the
       <a class="link" href="replication-options-binary-log.html#sysvar_binlog_cache_size">
        <code class="literal">
         binlog_cache_size
        </code>
       </a>
       system
            variable; in other words, changing its value affects only
            new sessions that are started after the value is changed.
      </p>
     </li>
     <li class="listitem">
      <p>
       <a name="sysvar_max_binlog_size">
       </a>
       <a class="link" href="replication-options-binary-log.html#sysvar_max_binlog_size">
        <code class="literal">
         max_binlog_size
        </code>
       </a>
      </p>
      <a class="indexterm" name="idm46045139446896">
      </a>
      <a class="indexterm" name="idm46045139445808">
      </a>
      <div class="informaltable">
       <table frame="box" rules="all" summary="Properties for max_binlog_size">
        <colgroup>
         <col style="width: 30%"/>
         <col style="width: 70%"/>
        </colgroup>
        <tbody>
         <tr>
          <th>
           Command-Line Format
          </th>
          <td>
           <code class="literal">
            --max-binlog-size=#
           </code>
          </td>
         </tr>
         <tr>
          <th>
           System Variable
          </th>
          <td>
           <code class="literal">
            <a class="link" href="replication-options-binary-log.html#sysvar_max_binlog_size">
             max_binlog_size
            </a>
           </code>
          </td>
         </tr>
         <tr>
          <th>
           Scope
          </th>
          <td>
           Global
          </td>
         </tr>
         <tr>
          <th>
           Dynamic
          </th>
          <td>
           Yes
          </td>
         </tr>
         <tr>
          <th>
           <a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
            <code class="literal">
             SET_VAR
            </code>
           </a>
           Hint Applies
          </th>
          <td>
           No
          </td>
         </tr>
         <tr>
          <th>
           Type
          </th>
          <td>
           Integer
          </td>
         </tr>
         <tr>
          <th>
           Default Value
          </th>
          <td>
           <code class="literal">
            1073741824
           </code>
          </td>
         </tr>
         <tr>
          <th>
           Minimum Value
          </th>
          <td>
           <code class="literal">
            4096
           </code>
          </td>
         </tr>
         <tr>
          <th>
           Maximum Value
          </th>
          <td>
           <code class="literal">
            1073741824
           </code>
          </td>
         </tr>
         <tr>
          <th>
           Unit
          </th>
          <td>
           bytes
          </td>
         </tr>
         <tr>
          <th>
           <a class="link" href="server-system-variables.html#system-variables-block-size" title="Note">
            Block Size
           </a>
          </th>
          <td>
           <code class="literal">
            4096
           </code>
          </td>
         </tr>
        </tbody>
       </table>
      </div>
      <p>
       If a write to the binary log causes the current log file
            size to exceed the value of this variable, the server
            rotates the binary logs (closes the current file and opens
            the next one). The minimum value is 4096 bytes. The maximum
            and default value is 1GB. Encrypted binary log files have an
            additional 512-byte header, which is included in
       <a class="link" href="replication-options-binary-log.html#sysvar_max_binlog_size">
        <code class="literal">
         max_binlog_size
        </code>
       </a>
       .
      </p>
      <p>
       A transaction is written in one chunk to the binary log, so
            it is never split between several binary logs. Therefore, if
            you have big transactions, you might see binary log files
            larger than
       <a class="link" href="replication-options-binary-log.html#sysvar_max_binlog_size">
        <code class="literal">
         max_binlog_size
        </code>
       </a>
       .
      </p>
      <p>
       If
       <a class="link" href="replication-options-replica.html#sysvar_max_relay_log_size">
        <code class="literal">
         max_relay_log_size
        </code>
       </a>
       is 0,
            the value of
       <a class="link" href="replication-options-binary-log.html#sysvar_max_binlog_size">
        <code class="literal">
         max_binlog_size
        </code>
       </a>
       applies to
            relay logs as well.
      </p>
      <p>
       With GTIDs in use on the server, when
       <a class="link" href="replication-options-binary-log.html#sysvar_max_binlog_size">
        <code class="literal">
         max_binlog_size
        </code>
       </a>
       is reached,
            if the system table
       <code class="literal">
        mysql.gtid_executed
       </code>
       cannot be accessed to write the GTIDs from the current
            binary log file, the binary log cannot be rotated. In this
            situation, the server responds according to its
       <a class="link" href="replication-options-binary-log.html#sysvar_binlog_error_action">
        <code class="literal">
         binlog_error_action
        </code>
       </a>
       setting. If
       <code class="literal">
        IGNORE_ERROR
       </code>
       is set, an error
            is logged on the server and binary logging is halted, or if
       <code class="literal">
        ABORT_SERVER
       </code>
       is set, the server shuts
            down.
      </p>
     </li>
     <li class="listitem">
      <p>
       <a name="sysvar_max_binlog_stmt_cache_size">
       </a>
       <a class="link" href="replication-options-binary-log.html#sysvar_max_binlog_stmt_cache_size">
        <code class="literal">
         max_binlog_stmt_cache_size
        </code>
       </a>
      </p>
      <a class="indexterm" name="idm46045139399440">
      </a>
      <a class="indexterm" name="idm46045139398336">
      </a>
      <div class="informaltable">
       <table frame="box" rules="all" summary="Properties for max_binlog_stmt_cache_size">
        <colgroup>
         <col style="width: 30%"/>
         <col style="width: 70%"/>
        </colgroup>
        <tbody>
         <tr>
          <th>
           Command-Line Format
          </th>
          <td>
           <code class="literal">
            --max-binlog-stmt-cache-size=#
           </code>
          </td>
         </tr>
         <tr>
          <th>
           System Variable
          </th>
          <td>
           <code class="literal">
            <a class="link" href="replication-options-binary-log.html#sysvar_max_binlog_stmt_cache_size">
             max_binlog_stmt_cache_size
            </a>
           </code>
          </td>
         </tr>
         <tr>
          <th>
           Scope
          </th>
          <td>
           Global
          </td>
         </tr>
         <tr>
          <th>
           Dynamic
          </th>
          <td>
           Yes
          </td>
         </tr>
         <tr>
          <th>
           <a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
            <code class="literal">
             SET_VAR
            </code>
           </a>
           Hint Applies
          </th>
          <td>
           No
          </td>
         </tr>
         <tr>
          <th>
           Type
          </th>
          <td>
           Integer
          </td>
         </tr>
         <tr>
          <th>
           Default Value
          </th>
          <td>
           <code class="literal">
            18446744073709547520
           </code>
          </td>
         </tr>
         <tr>
          <th>
           Minimum Value
          </th>
          <td>
           <code class="literal">
            4096
           </code>
          </td>
         </tr>
         <tr>
          <th>
           Maximum Value
          </th>
          <td>
           <code class="literal">
            18446744073709547520
           </code>
          </td>
         </tr>
         <tr>
          <th>
           Unit
          </th>
          <td>
           bytes
          </td>
         </tr>
         <tr>
          <th>
           <a class="link" href="server-system-variables.html#system-variables-block-size" title="Note">
            Block Size
           </a>
          </th>
          <td>
           <code class="literal">
            4096
           </code>
          </td>
         </tr>
        </tbody>
       </table>
      </div>
      <p>
       If nontransactional statements within a transaction require
            more than this many bytes of memory, the server generates an
            error. The minimum value is 4096. The maximum and default
            values are 4GB on 32-bit platforms and 16EB (exabytes) on
            64-bit platforms.
      </p>
      <p>
       <code class="literal">
        max_binlog_stmt_cache_size
       </code>
       sets the size
            for the statement cache only; the upper limit for the
            transaction cache is governed exclusively by the
       <a class="link" href="replication-options-binary-log.html#sysvar_max_binlog_cache_size">
        <code class="literal">
         max_binlog_cache_size
        </code>
       </a>
       system variable.
      </p>
     </li>
     <li class="listitem">
      <p>
       <a name="sysvar_original_commit_timestamp">
       </a>
       <a class="link" href="replication-options-binary-log.html#sysvar_original_commit_timestamp">
        <code class="literal">
         original_commit_timestamp
        </code>
       </a>
      </p>
      <a class="indexterm" name="idm46045139360592">
      </a>
      <a class="indexterm" name="idm46045139359488">
      </a>
      <div class="informaltable">
       <table frame="box" rules="all" summary="Properties for original_commit_timestamp">
        <colgroup>
         <col style="width: 30%"/>
         <col style="width: 70%"/>
        </colgroup>
        <tbody>
         <tr>
          <th>
           System Variable
          </th>
          <td>
           <code class="literal">
            <a class="link" href="replication-options-binary-log.html#sysvar_original_commit_timestamp">
             original_commit_timestamp
            </a>
           </code>
          </td>
         </tr>
         <tr>
          <th>
           Scope
          </th>
          <td>
           Session
          </td>
         </tr>
         <tr>
          <th>
           Dynamic
          </th>
          <td>
           Yes
          </td>
         </tr>
         <tr>
          <th>
           <a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
            <code class="literal">
             SET_VAR
            </code>
           </a>
           Hint Applies
          </th>
          <td>
           No
          </td>
         </tr>
         <tr>
          <th>
           Type
          </th>
          <td>
           Numeric
          </td>
         </tr>
        </tbody>
       </table>
      </div>
      <p>
       For internal use by replication. When re-executing a
            transaction on a replica, this is set to the time when the
            transaction was committed on the original source, measured
            in microseconds since the epoch. This allows the original
            commit timestamp to be propagated throughout a replication
            topology.
      </p>
      <p>
       Setting the session value of this system variable is a
            restricted operation. The session user must have either the
       <a class="link" href="privileges-provided.html#priv_replication-applier">
        <code class="literal">
         REPLICATION_APPLIER
        </code>
       </a>
       privilege
            (see
       <a class="xref" href="replication-privilege-checks.html" title="19.3.3 Replication Privilege Checks">
        Section 19.3.3, “Replication Privilege Checks”
       </a>
       ), or
            privileges sufficient to set restricted session variables
            (see
       <a class="xref" href="system-variable-privileges.html" title="7.1.9.1 System Variable Privileges">
        Section 7.1.9.1, “System Variable Privileges”
       </a>
       ). However,
            note that the variable is not intended for users to set; it
            is set automatically by the replication infrastructure.
      </p>
     </li>
     <li class="listitem">
      <p>
       <a name="sysvar_source_verify_checksum">
       </a>
       <a class="link" href="replication-options-binary-log.html#sysvar_source_verify_checksum">
        <code class="literal">
         source_verify_checksum
        </code>
       </a>
      </p>
      <a class="indexterm" name="idm46045139335984">
      </a>
      <a class="indexterm" name="idm46045139334944">
      </a>
      <div class="informaltable">
       <table frame="box" rules="all" summary="Properties for source_verify_checksum">
        <colgroup>
         <col style="width: 30%"/>
         <col style="width: 70%"/>
        </colgroup>
        <tbody>
         <tr>
          <th>
           Command-Line Format
          </th>
          <td>
           <code class="literal">
            --source-verify-checksum[={OFF|ON}]
           </code>
          </td>
         </tr>
         <tr>
          <th>
           System Variable
          </th>
          <td>
           <code class="literal">
            <a class="link" href="replication-options-binary-log.html#sysvar_source_verify_checksum">
             source_verify_checksum
            </a>
           </code>
          </td>
         </tr>
         <tr>
          <th>
           Scope
          </th>
          <td>
           Global
          </td>
         </tr>
         <tr>
          <th>
           Dynamic
          </th>
          <td>
           Yes
          </td>
         </tr>
         <tr>
          <th>
           <a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
            <code class="literal">
             SET_VAR
            </code>
           </a>
           Hint Applies
          </th>
          <td>
           No
          </td>
         </tr>
         <tr>
          <th>
           Type
          </th>
          <td>
           Boolean
          </td>
         </tr>
         <tr>
          <th>
           Default Value
          </th>
          <td>
           <code class="literal">
            OFF
           </code>
          </td>
         </tr>
        </tbody>
       </table>
      </div>
      <p>
       Enabling
       <a class="link" href="replication-options-binary-log.html#sysvar_source_verify_checksum">
        <code class="literal">
         source_verify_checksum
        </code>
       </a>
       causes the source to verify events read from the binary log
            by examining checksums, and to stop with an error in the
            event of a mismatch.
       <a class="link" href="replication-options-binary-log.html#sysvar_source_verify_checksum">
        <code class="literal">
         source_verify_checksum
        </code>
       </a>
       is
            disabled by default; in this case, the source uses the event
            length from the binary log to verify events, so that only
            complete events are read from the binary log.
      </p>
     </li>
     <li class="listitem">
      <p>
       <a name="sysvar_sql_log_bin">
       </a>
       <a class="link" href="replication-options-binary-log.html#sysvar_sql_log_bin">
        <code class="literal">
         sql_log_bin
        </code>
       </a>
      </p>
      <a class="indexterm" name="idm46045139307648">
      </a>
      <a class="indexterm" name="idm46045139306560">
      </a>
      <div class="informaltable">
       <table frame="box" rules="all" summary="Properties for sql_log_bin">
        <colgroup>
         <col style="width: 30%"/>
         <col style="width: 70%"/>
        </colgroup>
        <tbody>
         <tr>
          <th>
           System Variable
          </th>
          <td>
           <code class="literal">
            <a class="link" href="replication-options-binary-log.html#sysvar_sql_log_bin">
             sql_log_bin
            </a>
           </code>
          </td>
         </tr>
         <tr>
          <th>
           Scope
          </th>
          <td>
           Session
          </td>
         </tr>
         <tr>
          <th>
           Dynamic
          </th>
          <td>
           Yes
          </td>
         </tr>
         <tr>
          <th>
           <a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
            <code class="literal">
             SET_VAR
            </code>
           </a>
           Hint Applies
          </th>
          <td>
           No
          </td>
         </tr>
         <tr>
          <th>
           Type
          </th>
          <td>
           Boolean
          </td>
         </tr>
         <tr>
          <th>
           Default Value
          </th>
          <td>
           <code class="literal">
            ON
           </code>
          </td>
         </tr>
        </tbody>
       </table>
      </div>
      <p>
       This 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
       <code class="literal">
        ON
       </code>
       . To disable or enable binary logging
            for the current session, set the session
       <a class="link" href="replication-options-binary-log.html#sysvar_sql_log_bin">
        <code class="literal">
         sql_log_bin
        </code>
       </a>
       variable to
       <code class="literal">
        OFF
       </code>
       or
       <code class="literal">
        ON
       </code>
       .
      </p>
      <p>
       Set this variable to
       <code class="literal">
        OFF
       </code>
       for a session to
            temporarily disable binary logging while making changes to
            the source you do not want replicated to the replica.
      </p>
      <p>
       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
       <a class="xref" href="system-variable-privileges.html" title="7.1.9.1 System Variable Privileges">
        Section 7.1.9.1, “System Variable Privileges”
       </a>
       .
      </p>
      <p>
       It is not possible to set the session value of
       <a class="link" href="replication-options-binary-log.html#sysvar_sql_log_bin">
        <code class="literal">
         sql_log_bin
        </code>
       </a>
       within a
            transaction or subquery.
      </p>
      <p>
       <span class="emphasis">
        <em>
         Setting this variable to
         <code class="literal">
          OFF
         </code>
         prevents GTIDs from being assigned to transactions in the
            binary log
        </em>
       </span>
       . 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.
      </p>
     </li>
     <li class="listitem">
      <p>
       <a name="sysvar_sync_binlog">
       </a>
       <a class="link" href="replication-options-binary-log.html#sysvar_sync_binlog">
        <code class="literal">
         sync_binlog
        </code>
       </a>
      </p>
      <a class="indexterm" name="idm46045139274816">
      </a>
      <a class="indexterm" name="idm46045139273728">
      </a>
      <div class="informaltable">
       <table frame="box" rules="all" summary="Properties for sync_binlog">
        <colgroup>
         <col style="width: 30%"/>
         <col style="width: 70%"/>
        </colgroup>
        <tbody>
         <tr>
          <th>
           Command-Line Format
          </th>
          <td>
           <code class="literal">
            --sync-binlog=#
           </code>
          </td>
         </tr>
         <tr>
          <th>
           System Variable
          </th>
          <td>
           <code class="literal">
            <a class="link" href="replication-options-binary-log.html#sysvar_sync_binlog">
             sync_binlog
            </a>
           </code>
          </td>
         </tr>
         <tr>
          <th>
           Scope
          </th>
          <td>
           Global
          </td>
         </tr>
         <tr>
          <th>
           Dynamic
          </th>
          <td>
           Yes
          </td>
         </tr>
         <tr>
          <th>
           <a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
            <code class="literal">
             SET_VAR
            </code>
           </a>
           Hint Applies
          </th>
          <td>
           No
          </td>
         </tr>
         <tr>
          <th>
           Type
          </th>
          <td>
           Integer
          </td>
         </tr>
         <tr>
          <th>
           Default Value
          </th>
          <td>
           <code class="literal">
            1
           </code>
          </td>
         </tr>
         <tr>
          <th>
           Minimum Value
          </th>
          <td>
           <code class="literal">
            0
           </code>
          </td>
         </tr>
         <tr>
          <th>
           Maximum Value
          </th>
          <td>
           <code class="literal">
            4294967295
           </code>
          </td>
         </tr>
        </tbody>
       </table>
      </div>
      <p>
       Controls how often the MySQL server synchronizes the binary
            log to disk.
      </p>
      <div class="itemizedlist">
       <ul class="itemizedlist" style="list-style-type: circle; ">
        <li class="listitem">
         <p>
          <a class="link" href="replication-options-binary-log.html#sysvar_sync_binlog">
           <code class="literal">
            sync_binlog=0
           </code>
          </a>
          : Disables
                synchronization of the binary log to disk by the MySQL
                server. Instead, the MySQL server relies on the
                operating system to flush the binary log to disk from
                time to time as it does for any other file. This setting
                provides the best performance, but in the event of a
                power failure or operating system crash, it is possible
                that the server has committed transactions that have not
                been synchronized to the binary log.
         </p>
        </li>
        <li class="listitem">
         <p>
          <a class="link" href="replication-options-binary-log.html#sysvar_sync_binlog">
           <code class="literal">
            sync_binlog=1
           </code>
          </a>
          : Enables
                synchronization of the binary log to disk before
                transactions are committed. This is the safest setting
                but can have a negative impact on performance due to the
                increased number of disk writes. In the event of a power
                failure or operating system crash, transactions that are
                missing from the binary log are only in a prepared
                state. This permits the automatic recovery routine to
                roll back the transactions, which guarantees that no
                transaction is lost from the binary log.
         </p>
        </li>
        <li class="listitem">
         <p>
          <a class="link" href="replication-options-binary-log.html#sysvar_sync_binlog">
           <code class="literal">
            sync_binlog=
            <em class="replaceable">
             <code>
              N
             </code>
            </em>
           </code>
          </a>
          ,
                where
          <em class="replaceable">
           <code>
            N
           </code>
          </em>
          is a value other than
                0 or 1: The binary log is synchronized to disk after
          <code class="literal">
           N
          </code>
          binary log commit groups have been
                collected. In the event of a power failure or operating
                system crash, it is possible that the server has
                committed transactions that have not been flushed to the
                binary log. This setting can have a negative impact on
                performance due to the increased number of disk writes.
                A higher value improves performance, but with an
                increased risk of data loss.
         </p>
        </li>
       </ul>
      </div>
      <p>
       For the greatest possible durability and consistency in a
            replication setup that uses
       <code class="literal">
        InnoDB
       </code>
       with
            transactions, use these settings:
      </p>
      <div class="itemizedlist">
       <ul class="itemizedlist" style="list-style-type: circle; ">
        <li class="listitem">
         <p>
          <a class="link" href="replication-options-binary-log.html#sysvar_sync_binlog">
           <code class="literal">
            sync_binlog=1
           </code>
          </a>
          .
         </p>
        </li>
        <li class="listitem">
         <p>
          <a class="link" href="innodb-parameters.html#sysvar_innodb_flush_log_at_trx_commit">
           <code class="literal">
            innodb_flush_log_at_trx_commit=1
           </code>
          </a>
          .
         </p>
        </li>
       </ul>
      </div>
      <div class="caution" style="margin-left: 0.5in; margin-right: 0.5in;">
       <div class="admon-title">
        Caution
       </div>
       <p>
        Many operating systems and some disk hardware fool the
              flush-to-disk operation. They may tell
        <a class="link" href="mysqld.html" title="6.3.1 mysqld — The MySQL Server">
         <span class="command">
          <strong>
           mysqld
          </strong>
         </span>
        </a>
        that the flush has taken place,
              even though it has not. In this case, the durability of
              transactions is not guaranteed even with the recommended
              settings, and in the worst case, a power outage can
              corrupt
        <code class="literal">
         InnoDB
        </code>
        data. Using a
              battery-backed disk cache in the SCSI disk controller or
              in the disk itself speeds up file flushes, and makes the
              operation safer. You can also try to disable the caching
              of disk writes in hardware caches.
       </p>
      </div>
     </li>
    </ul>
   </div>
  </div>
 </div>
 <br/>
</div>
