<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h4 class="title">
      <a name="show-relaylog-events">
      </a>
      15.7.7.34 SHOW RELAYLOG EVENTS Statement
     </h4>
    </div>
   </div>
  </div>
  <a class="indexterm" name="idm46045169725936">
  </a>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa74669434"><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">RELAYLOG</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>
    <span class="token punctuation">[</span><em class="replaceable">channel_option</em><span class="token punctuation">]</span>

<em class="replaceable">channel_option</em>:
    <span class="token keyword">FOR</span> <span class="token keyword">CHANNEL</span> <span class="token keyword"><em class="replaceable">channel</em></span></code></pre>
  </div>
  <p>
   Shows the events in the relay log of a replica. If you do not
        specify
   <code class="literal">
    '
    <em class="replaceable">
     <code>
      log_name
     </code>
    </em>
    '
   </code>
   , the
        first relay log is displayed. This statement has no effect on
        the source.
   <code class="literal">
    SHOW RELAYLOG 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-relaylog-events.html" title="15.7.7.34 SHOW RELAYLOG EVENTS Statement">
     <code class="literal">
      SHOW RELAYLOG 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 relay log
          (including all statements modifying data that have been
          received by the replica).
   </p>
  </div>
  <p>
   The optional
   <code class="literal">
    FOR CHANNEL
    <em class="replaceable">
     <code>
      channel
     </code>
    </em>
   </code>
   clause enables you
        to name which replication channel the statement applies to.
        Providing a
   <code class="literal">
    FOR CHANNEL
    <em class="replaceable">
     <code>
      channel
     </code>
    </em>
   </code>
   clause applies the
        statement to a specific replication channel. If no channel is
        named and no extra channels exist, the statement applies to the
        default channel.
  </p>
  <p>
   When using multiple replication channels, if a
   <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>
   statement
        does not have a channel defined using a
   <code class="literal">
    FOR CHANNEL
    <em class="replaceable">
     <code>
      channel
     </code>
    </em>
   </code>
   clause an error is
        generated. See
   <a class="xref" href="replication-channels.html" title="19.2.2 Replication Channels">
    Section 19.2.2, “Replication Channels”
   </a>
   for more
        information.
  </p>
  <p>
   <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>
   displays the
        following fields for each event in the relay 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 value of
      <code class="literal">
       End_log_pos
      </code>
      for this event
            in the source's binary log.
     </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-relaylog-events.html" title="15.7.7.34 SHOW RELAYLOG EVENTS Statement">
    <code class="literal">
     SHOW
        RELAYLOG EVENTS
    </code>
   </a>
   . To get complete coverage of events
        within a relay 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>
 </div>
 <br/>
</div>
