<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h4 class="title">
      <a name="start-group-replication">
      </a>
      15.4.3.1 START GROUP_REPLICATION Statement
     </h4>
    </div>
   </div>
  </div>
  <a class="indexterm" name="idm46045176853024">
  </a>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa76646187"><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">START</span> <span class="token keyword">GROUP_REPLICATION</span>
          <span class="token punctuation">[</span><span class="token keyword">USER</span><span class="token operator">=</span><span class="token string">'<em class="replaceable">user_name</em>'</span><span class="token punctuation">]</span>
          <span class="token punctuation">[</span><span class="token punctuation">,</span> <span class="token keyword">PASSWORD</span><span class="token operator">=</span><span class="token string">'<em class="replaceable">user_pass</em>'</span><span class="token punctuation">]</span>
          <span class="token punctuation">[</span><span class="token punctuation">,</span> <span class="token keyword">DEFAULT_AUTH</span><span class="token operator">=</span><span class="token string">'<em class="replaceable">plugin_name</em>'</span><span class="token punctuation">]</span></code></pre>
  </div>
  <p>
   Starts group replication. This statement requires the
   <a class="link" href="privileges-provided.html#priv_group-replication-admin">
    <code class="literal">
     GROUP_REPLICATION_ADMIN
    </code>
   </a>
   privilege
        (or the deprecated
   <a class="link" href="privileges-provided.html#priv_super">
    <code class="literal">
     SUPER
    </code>
   </a>
   privilege). If
   <a class="link" href="server-system-variables.html#sysvar_super_read_only">
    <code class="literal">
     super_read_only=ON
    </code>
   </a>
   is set and
        the member should join as a primary,
   <a class="link" href="server-system-variables.html#sysvar_super_read_only">
    <code class="literal">
     super_read_only
    </code>
   </a>
   is set to
   <code class="literal">
    OFF
   </code>
   once Group Replication successfully
        starts.
  </p>
  <p>
   A server that participates in a group in single-primary mode
        should use
   <a class="link" href="replication-options-replica.html#sysvar_skip_replica_start">
    <code class="literal">
     skip_replica_start=ON
    </code>
   </a>
   .
        Otherwise, the server is not allowed to join a group as a
        secondary.
  </p>
  <p>
   You can specify user credentials for distributed recovery in the
   <code class="literal">
    START GROUP_REPLICATION
   </code>
   statement using the
   <code class="literal">
    USER
   </code>
   ,
   <code class="literal">
    PASSWORD
   </code>
   , and
   <code class="literal">
    DEFAULT_AUTH
   </code>
   options, as follows:
  </p>
  <div class="itemizedlist">
   <ul class="itemizedlist" style="list-style-type: disc; ">
    <li class="listitem">
     <p>
      <code class="literal">
       USER
      </code>
      : The replication user for
            distributed recovery. For instructions to set up this
            account, see
      <a class="xref" href="group-replication-user-credentials.html" title="20.2.1.3 User Credentials For Distributed Recovery">
       Section 20.2.1.3, “User Credentials For Distributed Recovery”
      </a>
      . You
            cannot specify an empty or null string, or omit the
      <code class="literal">
       USER
      </code>
      option if
      <code class="literal">
       PASSWORD
      </code>
      is specified.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       PASSWORD
      </code>
      : The password for the
            replication user account. The password cannot be encrypted,
            but it is masked in the query log.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       DEFAULT_AUTH
      </code>
      : The name of the
            authentication plugin used for the replication user account.
            If you do not specify this option, MySQL native
            authentication (the
      <code class="literal">
       mysql_native_password
      </code>
      plugin) is assumed. This option acts as a hint to the
            server, and the donor for distributed recovery overrides it
            if a different plugin is associated with the user account on
            that server. The authentication plugin used by default when
            you create user accounts in MySQL 8 is the caching SHA-2
            authentication plugin
            (
      <code class="literal">
       caching_sha2_password
      </code>
      ). See
      <a class="xref" href="pluggable-authentication.html" title="8.2.17 Pluggable Authentication">
       Section 8.2.17, “Pluggable Authentication”
      </a>
      for more
            information on authentication plugins.
     </p>
    </li>
   </ul>
  </div>
  <p>
   These credentials are used for distributed recovery on the
   <code class="literal">
    group_replication_recovery
   </code>
   channel. When you
        specify user credentials on
   <code class="literal">
    START
        GROUP_REPLICATION
   </code>
   , the credentials are saved in memory
        only, and are removed by a
   <code class="literal">
    STOP
        GROUP_REPLICATION
   </code>
   statement or server shutdown. You
        must issue a
   <code class="literal">
    START GROUP_REPLICATION
   </code>
   statement to provide the credentials again. This method is
        therefore not compatible with starting Group Replication
        automatically on server start, as specified by the
   <a class="link" href="group-replication-system-variables.html#sysvar_group_replication_start_on_boot">
    <code class="literal">
     group_replication_start_on_boot
    </code>
   </a>
   system variable.
  </p>
  <p>
   User credentials specified on
   <code class="literal">
    START
        GROUP_REPLICATION
   </code>
   take precedence over any user
        credentials set for the
   <code class="literal">
    group_replication_recovery
   </code>
   channel using a
   <a class="link" href="change-replication-source-to.html" title="15.4.2.2 CHANGE REPLICATION SOURCE TO Statement">
    <code class="literal">
     CHANGE REPLICATION SOURCE TO
    </code>
   </a>
   .
        Note that user credentials set using these statements are stored
        in the replication metadata repositories, and are used when
   <code class="literal">
    START GROUP_REPLICATION
   </code>
   is specified without
        user credentials, including automatic starts if the
   <a class="link" href="group-replication-system-variables.html#sysvar_group_replication_start_on_boot">
    <code class="literal">
     group_replication_start_on_boot
    </code>
   </a>
   system variable is set to
   <code class="literal">
    ON
   </code>
   . To gain the
        security benefits of specifying user credentials on
   <code class="literal">
    START GROUP_REPLICATION
   </code>
   , ensure that
   <a class="link" href="group-replication-system-variables.html#sysvar_group_replication_start_on_boot">
    <code class="literal">
     group_replication_start_on_boot
    </code>
   </a>
   is set to
   <code class="literal">
    OFF
   </code>
   (the default is
   <code class="literal">
    ON
   </code>
   ), and clear any user credentials
        previously set for the
   <code class="literal">
    group_replication_recovery
   </code>
   channel, following
        the instructions in
   <a class="xref" href="group-replication-distributed-recovery-securing.html" title="20.6.3 Securing Distributed Recovery Connections">
    Section 20.6.3, “Securing Distributed Recovery Connections”
   </a>
   .
  </p>
  <p>
   While a member is rejoining a replication group, its status can
        be displayed as
   <code class="literal">
    OFFLINE
   </code>
   or
   <code class="literal">
    ERROR
   </code>
   before the group completes the
        compatibility checks and accepts it as a member. When the member
        is catching up with the group's transactions, its status is
   <code class="literal">
    RECOVERING
   </code>
   .
  </p>
 </div>
 <br/>
</div>
