<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h4 class="title">
      <a name="clone-plugin-installation">
      </a>
      7.6.7.1 Installing the Clone Plugin
     </h4>
    </div>
   </div>
  </div>
  <a class="indexterm" name="idm46045255710528">
  </a>
  <a class="indexterm" name="idm46045255709040">
  </a>
  <p>
   This section describes how to install and configure the clone
        plugin. For remote cloning operations, the clone plugin must be
        installed on the donor and recipient MySQL server instances.
  </p>
  <p>
   For general information about installing or uninstalling
        plugins, see
   <a class="xref" href="plugin-loading.html" title="7.6.1 Installing and Uninstalling Plugins">
    Section 7.6.1, “Installing and Uninstalling Plugins”
   </a>
   .
  </p>
  <p>
   To be usable by the server, the plugin library file must be
        located in the MySQL plugin directory (the directory named by
        the
   <a class="link" href="server-system-variables.html#sysvar_plugin_dir">
    <code class="literal">
     plugin_dir
    </code>
   </a>
   system
        variable). If necessary, set the value of
   <a class="link" href="server-system-variables.html#sysvar_plugin_dir">
    <code class="literal">
     plugin_dir
    </code>
   </a>
   at server startup to
        tell the server the plugin directory location.
  </p>
  <p>
   The plugin library file base name is
   <code class="literal">
    mysql_clone.so
   </code>
   . The file name suffix differs
        by platform (for example,
   <code class="filename">
    .so
   </code>
   for Unix and
        Unix-like systems,
   <code class="filename">
    .dll
   </code>
   for Windows).
  </p>
  <p>
   To load the plugin at server startup, use the
   <a class="link" href="server-options.html#option_mysqld_plugin-load-add">
    <code class="option">
     --plugin-load-add
    </code>
   </a>
   option to name
        the library file that contains it. With this plugin-loading
        method, the option must be given each time the server starts.
        For example, put these lines in your
   <code class="filename">
    my.cnf
   </code>
   file, adjusting the plugin library file name extension for your
        platform as necessary. (The plugin library file name extension
        depends on your platform. Common suffixes are
   <code class="filename">
    .so
   </code>
   for Unix and Unix-like systems,
   <code class="filename">
    .dll
   </code>
   for Windows.)
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting language-ini"><div class="docs-select-all right" id="sa75520758"><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-ini"><span class="token selector">[mysqld]</span>
<span class="token constant">plugin-load-add</span><span class="token attr-value"><span class="token punctuation">=</span>mysql_clone.so</span></code></pre>
  </div>
  <p>
   After modifying
   <code class="filename">
    my.cnf
   </code>
   , restart the server
        to cause the new settings to take effect.
  </p>
  <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
   <div class="admon-title">
    Note
   </div>
   <p>
    The
    <a class="link" href="server-options.html#option_mysqld_plugin-load-add">
     <code class="option">
      --plugin-load-add
     </code>
    </a>
    option
          cannot be used to load the clone plugin when restarting the
          server during an upgrade from a previous MySQL version. In
          such cases, attempting to restart the server with
    <a class="link" href="server-options.html#option_mysqld_plugin-load-add">
     <code class="option">
      plugin-load-add=mysql_clone.so
     </code>
    </a>
    raises the error
    <span class="errortext">
     [ERROR] [MY-013238] [Server] Error
          installing plugin 'clone': Cannot install during
          upgrade.
    </span>
    To keep this from happening, upgrade the
          server before attempting to start the server with
    <a class="link" href="server-options.html#option_mysqld_plugin-load-add">
     <code class="option">
      plugin-load-add=mysql_clone.so
     </code>
    </a>
    .
   </p>
  </div>
  <p>
   Alternatively, to load the plugin at runtime, use this
        statement, adjusting the
   <code class="filename">
    .so
   </code>
   suffix for
        your platform as necessary:
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting one-line language-sql"><div class="docs-select-all right" id="sa45811432"><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">INSTALL</span> <span class="token keyword">PLUGIN</span> <span class="token keyword">clone</span> <span class="token keyword">SONAME</span> <span class="token string">'mysql_clone.so'</span><span class="token punctuation">;</span></code></pre>
  </div>
  <p>
   <a class="link" href="install-plugin.html" title="15.7.4.4 INSTALL PLUGIN Statement">
    <code class="literal">
     INSTALL PLUGIN
    </code>
   </a>
   loads the plugin,
        and also registers it in the
   <code class="literal">
    mysql.plugins
   </code>
   system table to cause the plugin to be loaded for each
        subsequent normal server startup without the need for
   <a class="link" href="server-options.html#option_mysqld_plugin-load-add">
    <code class="option">
     --plugin-load-add
    </code>
   </a>
   .
  </p>
  <p>
   To verify plugin installation, examine the Information Schema
   <a class="link" href="information-schema-plugins-table.html" title="28.3.22 The INFORMATION_SCHEMA PLUGINS Table">
    <code class="literal">
     PLUGINS
    </code>
   </a>
   table or use the
   <a class="link" href="show-plugins.html" title="15.7.7.27 SHOW PLUGINS Statement">
    <code class="literal">
     SHOW PLUGINS
    </code>
   </a>
   statement (see
   <a class="xref" href="obtaining-plugin-information.html" title="7.6.2 Obtaining Server Plugin Information">
    Section 7.6.2, “Obtaining Server Plugin Information”
   </a>
   ). For example:
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa7088920"><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">SELECT</span> PLUGIN_NAME<span class="token punctuation">,</span> PLUGIN_STATUS
       <span class="token keyword">FROM</span> INFORMATION_SCHEMA<span class="token punctuation">.</span><span class="token keyword">PLUGINS</span>
       <span class="token keyword">WHERE</span> PLUGIN_NAME <span class="token operator">=</span> <span class="token string">'clone'</span><span class="token punctuation">;</span>
<span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span>
<span class="token output"><span class="token punctuation">|</span> PLUGIN_NAME            <span class="token punctuation">|</span> PLUGIN_STATUS <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span>
<span class="token output"><span class="token punctuation">|</span> clone                  <span class="token punctuation">|</span> ACTIVE        <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span></code></pre>
  </div>
  <p>
   If the plugin fails to initialize, check the server error log
        for clone or plugin-related diagnostic messages.
  </p>
  <p>
   If the plugin has been previously registered with
   <a class="link" href="install-plugin.html" title="15.7.4.4 INSTALL PLUGIN Statement">
    <code class="literal">
     INSTALL PLUGIN
    </code>
   </a>
   or is loaded with
   <a class="link" href="server-options.html#option_mysqld_plugin-load-add">
    <code class="option">
     --plugin-load-add
    </code>
   </a>
   , you can use
        the
   <code class="option">
    --clone
   </code>
   option at server startup to control
        the plugin activation state. For example, to load the plugin at
        startup and prevent it from being removed at runtime, use these
        options:
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting language-ini"><div class="docs-select-all right" id="sa61299599"><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-ini"><span class="token selector">[mysqld]</span>
<span class="token constant">plugin-load-add</span><span class="token attr-value"><span class="token punctuation">=</span>mysql_clone.so</span>
<span class="token constant">clone</span><span class="token attr-value"><span class="token punctuation">=</span>FORCE_PLUS_PERMANENT</span></code></pre>
  </div>
  <p>
   If you want to prevent the server from running without the clone
        plugin, use
   <code class="option">
    --clone
   </code>
   with a value of
   <code class="literal">
    FORCE
   </code>
   or
   <code class="literal">
    FORCE_PLUS_PERMANENT
   </code>
   to force server startup
        to fail if the plugin does not initialize successfully.
  </p>
  <p>
   For more information about plugin activation states, see
   <a class="xref" href="plugin-loading.html#server-plugin-activating" title="Controlling Plugin Activation State">
    Controlling Plugin Activation State
   </a>
   .
  </p>
 </div>
 <br/>
</div>
