<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h4 class="title">
      <a name="replication-administration-pausing">
      </a>
      19.1.7.2 Pausing Replication on the Replica
     </h4>
    </div>
   </div>
  </div>
  <p>
   You can stop and start replication on the replica using the
   <a class="link" href="stop-replica.html" title="15.4.2.5 STOP REPLICA Statement">
    <code class="literal">
     STOP REPLICA
    </code>
   </a>
   and
   <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>
   To stop processing of the binary log from the source, use
   <a class="link" href="stop-replica.html" title="15.4.2.5 STOP REPLICA Statement">
    <code class="literal">
     STOP REPLICA
    </code>
   </a>
   :
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting one-line language-sql"><div class="docs-select-all right" id="sa73992186"><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 prompt">mysql&gt;</span> <span class="token keyword">STOP</span> <span class="token keyword">REPLICA</span><span class="token punctuation">;</span></code></pre>
  </div>
  <p>
   When replication is stopped, the replication I/O (receiver)
        thread stops reading events from the source binary log and
        writing them to the relay log, and the SQL thread stops reading
        events from the relay log and executing them. You can pause the
        I/O (receiver) or SQL (applier) thread individually by
        specifying the thread type:
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa16640149"><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 prompt">mysql&gt;</span> <span class="token keyword">STOP</span> <span class="token keyword">REPLICA</span> <span class="token keyword">IO_THREAD</span><span class="token punctuation">;</span>
<span class="token prompt">mysql&gt;</span> <span class="token keyword">STOP</span> <span class="token keyword">REPLICA</span> <span class="token keyword">SQL_THREAD</span><span class="token punctuation">;</span></code></pre>
  </div>
  <p>
   To start execution again, use the
   <a class="link" href="start-replica.html" title="15.4.2.4 START REPLICA Statement">
    <code class="literal">
     START
        REPLICA
    </code>
   </a>
   statement:
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting one-line language-sql"><div class="docs-select-all right" id="sa45707296"><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 prompt">mysql&gt;</span> <span class="token keyword">START</span> <span class="token keyword">REPLICA</span><span class="token punctuation">;</span></code></pre>
  </div>
  <p>
   To start a particular thread, specify the thread type:
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa79435392"><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 prompt">mysql&gt;</span> <span class="token keyword">START</span> <span class="token keyword">REPLICA</span> <span class="token keyword">IO_THREAD</span><span class="token punctuation">;</span>
<span class="token prompt">mysql&gt;</span> <span class="token keyword">START</span> <span class="token keyword">REPLICA</span> <span class="token keyword">SQL_THREAD</span><span class="token punctuation">;</span></code></pre>
  </div>
  <p>
   For a replica that performs updates only by processing events
        from the source, stopping only the SQL thread can be useful if
        you want to perform a backup or other task. The I/O (receiver)
        thread continues to read events from the source but they are not
        executed. This makes it easier for the replica to catch up when
        you restart the SQL (applier) thread.
  </p>
  <p>
   Stopping only the receiver thread enables the events in the
        relay log to be executed by the applier thread up to the point
        where the relay log ends. This can be useful when you want to
        pause execution to catch up with events already received from
        the source, when you want to perform administration on the
        replica but also ensure that it has processed all updates to a
        specific point. This method can also be used to pause event
        receipt on the replica while you conduct administration on the
        source. Stopping the receiver thread but permitting the applier
        thread to run helps ensure that there is not a massive backlog
        of events to be executed when replication is started again.
  </p>
 </div>
 <br/>
</div>
