<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h4 class="title">
      <a name="binary-log-mysql-database">
      </a>
      7.4.4.4 Logging Format for Changes to mysql Database Tables
     </h4>
    </div>
   </div>
  </div>
  <p>
   The contents of the grant tables in the
   <code class="literal">
    mysql
   </code>
   database can be modified directly (for example, with
   <a class="link" href="insert.html" title="15.2.7 INSERT Statement">
    <code class="literal">
     INSERT
    </code>
   </a>
   or
   <a class="link" href="delete.html" title="15.2.2 DELETE Statement">
    <code class="literal">
     DELETE
    </code>
   </a>
   ) or indirectly (for
        example, with
   <a class="link" href="grant.html" title="15.7.1.6 GRANT Statement">
    <code class="literal">
     GRANT
    </code>
   </a>
   or
   <a class="link" href="create-user.html" title="15.7.1.3 CREATE USER Statement">
    <code class="literal">
     CREATE USER
    </code>
   </a>
   ). Statements that
        affect
   <code class="literal">
    mysql
   </code>
   database tables are written to
        the binary log using the following rules:
  </p>
  <div class="itemizedlist">
   <ul class="itemizedlist" style="list-style-type: disc; ">
    <li class="listitem">
     <p>
      Data manipulation statements that change data in
      <code class="literal">
       mysql
      </code>
      database tables directly are logged
            according to the setting of the
      <a class="link" href="replication-options-binary-log.html#sysvar_binlog_format">
       <code class="literal">
        binlog_format
       </code>
      </a>
      system
            variable. This pertains to statements such as
      <a class="link" href="insert.html" title="15.2.7 INSERT Statement">
       <code class="literal">
        INSERT
       </code>
      </a>
      ,
      <a class="link" href="update.html" title="15.2.17 UPDATE Statement">
       <code class="literal">
        UPDATE
       </code>
      </a>
      ,
      <a class="link" href="delete.html" title="15.2.2 DELETE Statement">
       <code class="literal">
        DELETE
       </code>
      </a>
      ,
      <a class="link" href="replace.html" title="15.2.12 REPLACE Statement">
       <code class="literal">
        REPLACE
       </code>
      </a>
      ,
      <a class="link" href="do.html" title="15.2.3 DO Statement">
       <code class="literal">
        DO
       </code>
      </a>
      ,
      <a class="link" href="load-data.html" title="15.2.9 LOAD DATA Statement">
       <code class="literal">
        LOAD
            DATA
       </code>
      </a>
      ,
      <a class="link" href="select.html" title="15.2.13 SELECT Statement">
       <code class="literal">
        SELECT
       </code>
      </a>
      , and
      <a class="link" href="truncate-table.html" title="15.1.37 TRUNCATE TABLE Statement">
       <code class="literal">
        TRUNCATE TABLE
       </code>
      </a>
      .
     </p>
    </li>
    <li class="listitem">
     <p>
      Statements that change the
      <code class="literal">
       mysql
      </code>
      database
            indirectly are logged as statements regardless of the value
            of
      <a class="link" href="replication-options-binary-log.html#sysvar_binlog_format">
       <code class="literal">
        binlog_format
       </code>
      </a>
      . This
            pertains to statements such as
      <a class="link" href="grant.html" title="15.7.1.6 GRANT Statement">
       <code class="literal">
        GRANT
       </code>
      </a>
      ,
      <a class="link" href="revoke.html" title="15.7.1.8 REVOKE Statement">
       <code class="literal">
        REVOKE
       </code>
      </a>
      ,
      <a class="link" href="set-password.html" title="15.7.1.10 SET PASSWORD Statement">
       <code class="literal">
        SET PASSWORD
       </code>
      </a>
      ,
      <a class="link" href="rename-user.html" title="15.7.1.7 RENAME USER Statement">
       <code class="literal">
        RENAME USER
       </code>
      </a>
      ,
      <code class="literal">
       CREATE
      </code>
      (all forms except
      <a class="link" href="create-table.html" title="15.1.20 CREATE TABLE Statement">
       <code class="literal">
        CREATE TABLE
            ... SELECT
       </code>
      </a>
      ),
      <code class="literal">
       ALTER
      </code>
      (all forms),
            and
      <code class="literal">
       DROP
      </code>
      (all forms).
     </p>
    </li>
   </ul>
  </div>
  <p>
   <a class="link" href="create-table.html" title="15.1.20 CREATE TABLE Statement">
    <code class="literal">
     CREATE TABLE ...
        SELECT
    </code>
   </a>
   is a combination of data definition and data
        manipulation. The
   <a class="link" href="create-table.html" title="15.1.20 CREATE TABLE Statement">
    <code class="literal">
     CREATE TABLE
    </code>
   </a>
   part is logged using statement format and the
   <a class="link" href="select.html" title="15.2.13 SELECT Statement">
    <code class="literal">
     SELECT
    </code>
   </a>
   part is logged according
        to the value of
   <a class="link" href="replication-options-binary-log.html#sysvar_binlog_format">
    <code class="literal">
     binlog_format
    </code>
   </a>
   .
  </p>
 </div>
 <br/>
</div>
