<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h4 class="title">
      <a name="mysqlbinlog-server-id">
      </a>
      6.6.9.4 Specifying the mysqlbinlog Server ID
     </h4>
    </div>
   </div>
  </div>
  <p>
   When invoked with the
   <code class="option">
    --read-from-remote-server
   </code>
   option,
   <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>
   connects to a MySQL
        server, specifies a server ID to identify itself, and requests
        binary log files from the server. You can 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>
   to request log files from a
        server in several ways:
  </p>
  <div class="itemizedlist">
   <ul class="itemizedlist" style="list-style-type: disc; ">
    <li class="listitem">
     <p>
      Specify an explicitly named set of files: For each file,
      <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>
      connects and issues a
      <code class="literal">
       Binlog dump
      </code>
      command. The server sends the
            file and disconnects. There is one connection per file.
     </p>
    </li>
    <li class="listitem">
     <p>
      Specify the beginning file and
      <a class="link" href="mysqlbinlog.html#option_mysqlbinlog_to-last-log">
       <code class="option">
        --to-last-log
       </code>
      </a>
      :
      <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>
      connects and issues a
      <code class="literal">
       Binlog dump
      </code>
      command for all files. The
            server sends all files and disconnects.
     </p>
    </li>
    <li class="listitem">
     <p>
      Specify the beginning file and
      <a class="link" href="mysqlbinlog.html#option_mysqlbinlog_stop-never">
       <code class="option">
        --stop-never
       </code>
      </a>
      (which
            implies
      <a class="link" href="mysqlbinlog.html#option_mysqlbinlog_to-last-log">
       <code class="option">
        --to-last-log
       </code>
      </a>
      ):
      <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>
      connects and issues a
      <code class="literal">
       Binlog dump
      </code>
      command for all files. The
            server sends all files, but does not disconnect after
            sending the last one.
     </p>
    </li>
   </ul>
  </div>
  <p>
   With
   <a class="link" href="mysqlbinlog.html#option_mysqlbinlog_read-from-remote-server">
    <code class="option">
     --read-from-remote-server
    </code>
   </a>
   only,
   <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>
   connects using a server ID
        of 0, which tells the server to disconnect after sending the
        last requested log file.
  </p>
  <p>
   With
   <a class="link" href="mysqlbinlog.html#option_mysqlbinlog_read-from-remote-server">
    <code class="option">
     --read-from-remote-server
    </code>
   </a>
   and
   <a class="link" href="mysqlbinlog.html#option_mysqlbinlog_stop-never">
    <code class="option">
     --stop-never
    </code>
   </a>
   ,
   <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>
   connects using a nonzero server
        ID, so the server does not disconnect after sending the last log
        file. The server ID is 1 by default, but this can be changed
        with
   <a class="link" href="mysqlbinlog.html#option_mysqlbinlog_connection-server-id">
    <code class="option">
     --connection-server-id
    </code>
   </a>
   .
  </p>
  <p>
   Thus, for the first two ways of requesting files, the server
        disconnects because
   <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>
   specifies a
        server ID of 0. It does not disconnect if
   <a class="link" href="mysqlbinlog.html#option_mysqlbinlog_stop-never">
    <code class="option">
     --stop-never
    </code>
   </a>
   is given
        because
   <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>
   specifies a nonzero
        server ID.
  </p>
 </div>
 <br/>
</div>
