<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h4 class="title">
      <a name="show-binlog-events">
      </a>
      15.7.7.3 SHOW BINLOG EVENTS Statement
     </h4>
    </div>
   </div>
  </div>
  <a class="indexterm" name="idm46045171182224">
  </a>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa49966678"><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">SHOW</span> <span class="token keyword">BINLOG</span> <span class="token keyword">EVENTS</span>
   <span class="token punctuation">[</span><span class="token keyword">IN</span> <span class="token string">'<em class="replaceable">log_name</em>'</span><span class="token punctuation">]</span>
   <span class="token punctuation">[</span><span class="token keyword">FROM</span> <em class="replaceable">pos</em><span class="token punctuation">]</span>
   <span class="token punctuation">[</span><span class="token keyword">LIMIT</span> <span class="token punctuation">[</span><span class="token keyword"><em class="replaceable">offset</em></span><span class="token punctuation">,</span><span class="token punctuation">]</span> <span class="token keyword"><em class="replaceable">row_count</em></span><span class="token punctuation">]</span></code></pre>
  </div>
  <p>
   Shows the events in the binary log. If you do not specify
   <code class="literal">
    '
    <em class="replaceable">
     <code>
      log_name
     </code>
    </em>
    '
   </code>
   , the
        first binary log is displayed.
   <code class="literal">
    SHOW BINLOG
        EVENTS
   </code>
   requires the
   <a class="link" href="privileges-provided.html#priv_replication-slave">
    <code class="literal">
     REPLICATION
        SLAVE
    </code>
   </a>
   privilege.
  </p>
  <p>
   The
   <code class="literal">
    LIMIT
   </code>
   clause has the same syntax as for
        the
   <a class="link" href="select.html" title="15.2.13 SELECT Statement">
    <code class="literal">
     SELECT
    </code>
   </a>
   statement. See
   <a class="xref" href="select.html" title="15.2.13 SELECT Statement">
    Section 15.2.13, “SELECT Statement”
   </a>
   .
  </p>
  <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
   <div class="admon-title">
    Note
   </div>
   <p>
    Issuing a
    <a class="link" href="show-binlog-events.html" title="15.7.7.3 SHOW BINLOG EVENTS Statement">
     <code class="literal">
      SHOW BINLOG EVENTS
     </code>
    </a>
    with no
    <code class="literal">
     LIMIT
    </code>
    clause could start a very
          time- and resource-consuming process because the server
          returns to the client the complete contents of the binary log
          (which includes all statements executed by the server that
          modify data). As an alternative to
    <a class="link" href="show-binlog-events.html" title="15.7.7.3 SHOW BINLOG EVENTS Statement">
     <code class="literal">
      SHOW
          BINLOG EVENTS
     </code>
    </a>
    , use the
    <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>
    utility to save the binary log
          to a text file for later examination and analysis. See
    <a class="xref" href="mysqlbinlog.html" title="6.6.9 mysqlbinlog — Utility for Processing Binary Log Files">
     Section 6.6.9, “mysqlbinlog — Utility for Processing Binary Log Files”
    </a>
    .
   </p>
  </div>
  <p>
   <a class="link" href="show-binlog-events.html" title="15.7.7.3 SHOW BINLOG EVENTS Statement">
    <code class="literal">
     SHOW BINLOG EVENTS
    </code>
   </a>
   displays the
        following fields for each event in the binary log:
  </p>
  <div class="itemizedlist">
   <ul class="itemizedlist" style="list-style-type: disc; ">
    <li class="listitem">
     <p>
      <code class="literal">
       Log_name
      </code>
     </p>
     <p>
      The name of the file that is being listed.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       Pos
      </code>
     </p>
     <p>
      The position at which the event occurs.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       Event_type
      </code>
     </p>
     <p>
      An identifier that describes the event type.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       Server_id
      </code>
     </p>
     <p>
      The server ID of the server on which the event originated.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       End_log_pos
      </code>
     </p>
     <p>
      The position at which the next event begins, which is equal
            to
      <code class="literal">
       Pos
      </code>
      plus the size of the event.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       Info
      </code>
     </p>
     <p>
      More detailed information about the event type. The format
            of this information depends on the event type.
     </p>
    </li>
   </ul>
  </div>
  <p>
   For compressed transaction payloads, the
   <code class="literal">
    Transaction_payload_event
   </code>
   is first printed as
        a single unit, then it is unpacked and each event inside it is
        printed.
  </p>
  <p>
   Some events relating to the setting of user and system variables
        are not included in the output from
   <a class="link" href="show-binlog-events.html" title="15.7.7.3 SHOW BINLOG EVENTS Statement">
    <code class="literal">
     SHOW
        BINLOG EVENTS
    </code>
   </a>
   . To get complete coverage of events
        within a binary log, use
   <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>
   .
  </p>
  <p>
   <a class="link" href="show-binlog-events.html" title="15.7.7.3 SHOW BINLOG EVENTS Statement">
    <code class="literal">
     SHOW BINLOG EVENTS
    </code>
   </a>
   does
   <span class="emphasis">
    <em>
     not
    </em>
   </span>
   work with relay log files. You can use
   <a class="link" href="show-relaylog-events.html" title="15.7.7.34 SHOW RELAYLOG EVENTS Statement">
    <code class="literal">
     SHOW RELAYLOG EVENTS
    </code>
   </a>
   for this
        purpose.
  </p>
 </div>
 <br/>
</div>
