<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h3 class="title">
      <a name="plugin-loading">
      </a>
      7.6.1 Installing and Uninstalling Plugins
     </h3>
    </div>
   </div>
  </div>
  <a class="indexterm" name="idm46045257098720">
  </a>
  <a class="indexterm" name="idm46045257097680">
  </a>
  <a class="indexterm" name="idm46045257096192">
  </a>
  <a class="indexterm" name="idm46045257095120">
  </a>
  <a class="indexterm" name="idm46045257093632">
  </a>
  <a class="indexterm" name="idm46045257092560">
  </a>
  <p>
   Server plugins must be loaded into the server before they can be
      used. MySQL supports plugin loading at server startup and runtime.
      It is also possible to control the activation state of loaded
      plugins at startup, and to unload them at runtime.
  </p>
  <p>
   While a plugin is loaded, information about it is available as
      described in
   <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>
   .
  </p>
  <div class="itemizedlist">
   <ul class="itemizedlist" style="list-style-type: disc; ">
    <li class="listitem">
     <p>
      <a class="xref" href="plugin-loading.html#server-plugin-installing" title="Installing Plugins">
       Installing Plugins
      </a>
     </p>
    </li>
    <li class="listitem">
     <p>
      <a class="xref" href="plugin-loading.html#server-plugin-activating" title="Controlling Plugin Activation State">
       Controlling Plugin Activation State
      </a>
     </p>
    </li>
    <li class="listitem">
     <p>
      <a class="xref" href="plugin-loading.html#server-plugin-uninstalling" title="Uninstalling Plugins">
       Uninstalling Plugins
      </a>
     </p>
    </li>
    <li class="listitem">
     <p>
      <a class="xref" href="plugin-loading.html#server-plugin-loadable-function-installing" title="Plugins and Loadable Functions">
       Plugins and Loadable Functions
      </a>
     </p>
    </li>
   </ul>
  </div>
  <div class="simplesect">
   <div class="titlepage">
    <div>
     <div class="simple">
      <h4 class="title">
       <a name="server-plugin-installing">
       </a>
       Installing Plugins
      </h4>
     </div>
    </div>
   </div>
   <p>
    Before a server plugin can be used, it must be installed using
        one of the following methods. In the descriptions,
    <em class="replaceable">
     <code>
      plugin_name
     </code>
    </em>
    stands for a plugin name
        such as
    <code class="literal">
     innodb
    </code>
    ,
    <code class="literal">
     csv
    </code>
    , or
    <code class="literal">
     validate_password
    </code>
    .
   </p>
   <div class="itemizedlist">
    <ul class="itemizedlist" style="list-style-type: disc; ">
     <li class="listitem">
      <p>
       <a class="xref" href="plugin-loading.html#server-plugin-installing-built-in" title="Built-in Plugins">
        Built-in Plugins
       </a>
      </p>
     </li>
     <li class="listitem">
      <p>
       <a class="xref" href="plugin-loading.html#server-plugin-installing-system-table" title="Plugins Registered in the mysql.plugin System Table">
        Plugins Registered in the mysql.plugin System Table
       </a>
      </p>
     </li>
     <li class="listitem">
      <p>
       <a class="xref" href="plugin-loading.html#server-plugin-installing-command-line" title="Plugins Named with Command-Line Options">
        Plugins Named with Command-Line Options
       </a>
      </p>
     </li>
     <li class="listitem">
      <p>
       <a class="xref" href="plugin-loading.html#server-plugin-installing-install-plugin" title="Plugins Installed with the INSTALL PLUGIN Statement">
        Plugins Installed with the INSTALL PLUGIN Statement
       </a>
      </p>
     </li>
    </ul>
   </div>
   <h5>
    <a name="server-plugin-installing-built-in">
    </a>
    Built-in Plugins
   </h5>
   <p>
    A built-in plugin is known by the server automatically. By
        default, the server enables the plugin at startup. Some built-in
        plugins permit this to be changed with the
    <code class="option">
     --
     <em class="replaceable">
      <code>
       plugin_name
      </code>
     </em>
     [=
     <em class="replaceable">
      <code>
       activation_state
      </code>
     </em>
     ]
    </code>
    option.
   </p>
   <h5>
    <a name="server-plugin-installing-system-table">
    </a>
    Plugins Registered in the mysql.plugin System Table
   </h5>
   <p>
    The
    <code class="literal">
     mysql.plugin
    </code>
    system table serves as a
        registry of plugins (other than built-in plugins, which need not
        be registered). During the normal startup sequence, the server
        loads plugins registered in the table. By default, for a plugin
        loaded from the
    <code class="literal">
     mysql.plugin
    </code>
    table, the
        server also enables the plugin. This can be changed with the
    <code class="option">
     --
     <em class="replaceable">
      <code>
       plugin_name
      </code>
     </em>
     [=
     <em class="replaceable">
      <code>
       activation_state
      </code>
     </em>
     ]
    </code>
    option.
   </p>
   <p>
    If the server is started with the
    <a class="link" href="server-options.html#option_mysqld_skip-grant-tables">
     <code class="option">
      --skip-grant-tables
     </code>
    </a>
    option,
        plugins registered in the
    <code class="literal">
     mysql.plugin
    </code>
    table
        are not loaded and are unavailable.
   </p>
   <h5>
    <a name="server-plugin-installing-command-line">
    </a>
    Plugins Named with Command-Line Options
   </h5>
   <p>
    A plugin located in a plugin library file can be loaded at
        server startup with the
    <a class="link" href="server-options.html#option_mysqld_plugin-load">
     <code class="option">
      --plugin-load
     </code>
    </a>
    ,
    <a class="link" href="server-options.html#option_mysqld_plugin-load-add">
     <code class="option">
      --plugin-load-add
     </code>
    </a>
    , or
    <a class="link" href="server-options.html#option_mysqld_early-plugin-load">
     <code class="option">
      --early-plugin-load
     </code>
    </a>
    option.
        Normally, for a plugin loaded at startup, the server also
        enables the plugin. This can be changed with the
    <code class="option">
     --
     <em class="replaceable">
      <code>
       plugin_name
      </code>
     </em>
     [=
     <em class="replaceable">
      <code>
       activation_state
      </code>
     </em>
     ]
    </code>
    option.
   </p>
   <p>
    The
    <a class="link" href="server-options.html#option_mysqld_plugin-load">
     <code class="option">
      --plugin-load
     </code>
    </a>
    and
    <a class="link" href="server-options.html#option_mysqld_plugin-load-add">
     <code class="option">
      --plugin-load-add
     </code>
    </a>
    options load
        plugins after built-in plugins and storage engines have
        initialized during the server startup sequence. The
    <a class="link" href="server-options.html#option_mysqld_early-plugin-load">
     <code class="option">
      --early-plugin-load
     </code>
    </a>
    option is
        used to load plugins that must be available prior to
        initialization of built-in plugins and storage engines.
   </p>
   <p>
    The value of each plugin-loading option is a semicolon-separated
        list of
    <em class="replaceable">
     <code>
      plugin_library
     </code>
    </em>
    and
    <em class="replaceable">
     <code>
      name
     </code>
    </em>
    <code class="literal">
     =
    </code>
    <em class="replaceable">
     <code>
      plugin_library
     </code>
    </em>
    values. Each
    <em class="replaceable">
     <code>
      plugin_library
     </code>
    </em>
    is the
        name of a library file that contains plugin code, and each
    <em class="replaceable">
     <code>
      name
     </code>
    </em>
    is the name of a plugin to load.
        If a plugin library is named without any preceding plugin name,
        the server loads all plugins in the library. With a preceding
        plugin name, the server loads only the named plugin from the
        library. The server looks for plugin library files in 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.
   </p>
   <p>
    Plugin-loading options do not register any plugin in the
    <code class="literal">
     mysql.plugin
    </code>
    table. For subsequent restarts,
        the server loads the plugin again only if
    <a class="link" href="server-options.html#option_mysqld_plugin-load">
     <code class="option">
      --plugin-load
     </code>
    </a>
    ,
    <a class="link" href="server-options.html#option_mysqld_plugin-load-add">
     <code class="option">
      --plugin-load-add
     </code>
    </a>
    , or
    <a class="link" href="server-options.html#option_mysqld_early-plugin-load">
     <code class="option">
      --early-plugin-load
     </code>
    </a>
    is given
        again. That is, the option produces a one-time
        plugin-installation operation that persists for a single server
        invocation.
   </p>
   <p>
    <a class="link" href="server-options.html#option_mysqld_plugin-load">
     <code class="option">
      --plugin-load
     </code>
    </a>
    ,
    <a class="link" href="server-options.html#option_mysqld_plugin-load-add">
     <code class="option">
      --plugin-load-add
     </code>
    </a>
    , and
    <a class="link" href="server-options.html#option_mysqld_early-plugin-load">
     <code class="option">
      --early-plugin-load
     </code>
    </a>
    enable
        plugins to be loaded even when
    <a class="link" href="server-options.html#option_mysqld_skip-grant-tables">
     <code class="option">
      --skip-grant-tables
     </code>
    </a>
    is given
        (which causes the server to ignore the
    <code class="literal">
     mysql.plugin
    </code>
    table).
    <a class="link" href="server-options.html#option_mysqld_plugin-load">
     <code class="option">
      --plugin-load
     </code>
    </a>
    ,
    <a class="link" href="server-options.html#option_mysqld_plugin-load-add">
     <code class="option">
      --plugin-load-add
     </code>
    </a>
    , and
    <a class="link" href="server-options.html#option_mysqld_early-plugin-load">
     <code class="option">
      --early-plugin-load
     </code>
    </a>
    also enable
        plugins to be loaded at startup that cannot be loaded at
        runtime.
   </p>
   <p>
    The
    <a class="link" href="server-options.html#option_mysqld_plugin-load-add">
     <code class="option">
      --plugin-load-add
     </code>
    </a>
    option
        complements the
    <a class="link" href="server-options.html#option_mysqld_plugin-load">
     <code class="option">
      --plugin-load
     </code>
    </a>
    option:
   </p>
   <div class="itemizedlist">
    <ul class="itemizedlist" style="list-style-type: disc; ">
     <li class="listitem">
      <p>
       Each instance of
       <a class="link" href="server-options.html#option_mysqld_plugin-load">
        <code class="option">
         --plugin-load
        </code>
       </a>
       resets the set
            of plugins to load at startup, whereas
       <a class="link" href="server-options.html#option_mysqld_plugin-load-add">
        <code class="option">
         --plugin-load-add
        </code>
       </a>
       adds a
            plugin or plugins to the set of plugins to be loaded without
            resetting the current set. Consequently, if multiple
            instances of
       <a class="link" href="server-options.html#option_mysqld_plugin-load">
        <code class="option">
         --plugin-load
        </code>
       </a>
       are specified, only the last one applies. With multiple
            instances of
       <a class="link" href="server-options.html#option_mysqld_plugin-load-add">
        <code class="option">
         --plugin-load-add
        </code>
       </a>
       , all of
            them apply.
      </p>
     </li>
     <li class="listitem">
      <p>
       The argument format is the same as for
       <a class="link" href="server-options.html#option_mysqld_plugin-load">
        <code class="option">
         --plugin-load
        </code>
       </a>
       , but multiple
            instances of
       <a class="link" href="server-options.html#option_mysqld_plugin-load-add">
        <code class="option">
         --plugin-load-add
        </code>
       </a>
       can be used
            to avoid specifying a large set of plugins as a single long
            unwieldy
       <a class="link" href="server-options.html#option_mysqld_plugin-load">
        <code class="option">
         --plugin-load
        </code>
       </a>
       argument.
      </p>
     </li>
     <li class="listitem">
      <p>
       <a class="link" href="server-options.html#option_mysqld_plugin-load-add">
        <code class="option">
         --plugin-load-add
        </code>
       </a>
       can be
            given in the absence of
       <a class="link" href="server-options.html#option_mysqld_plugin-load">
        <code class="option">
         --plugin-load
        </code>
       </a>
       , but any
            instance of
       <a class="link" href="server-options.html#option_mysqld_plugin-load-add">
        <code class="option">
         --plugin-load-add
        </code>
       </a>
       that appears before
       <a class="link" href="server-options.html#option_mysqld_plugin-load">
        <code class="option">
         --plugin-load
        </code>
       </a>
       has no effect
            because
       <a class="link" href="server-options.html#option_mysqld_plugin-load">
        <code class="option">
         --plugin-load
        </code>
       </a>
       resets
            the set of plugins to load.
      </p>
     </li>
    </ul>
   </div>
   <p>
    For example, these options:
   </p>
   <div class="copytoclipboard-wrapper">
    <pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa44252061"><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-terminal"><span class="token constant">--plugin-load</span><span class="token attr-value"><span class="token punctuation">=</span>x</span> <span class="token constant">--plugin-load-add</span><span class="token attr-value"><span class="token punctuation">=</span>y</span></code></pre>
   </div>
   <p>
    are equivalent to these options:
   </p>
   <div class="copytoclipboard-wrapper">
    <pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa74990702"><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-terminal"><span class="token constant">--plugin-load-add</span><span class="token attr-value"><span class="token punctuation">=</span>x</span> <span class="token constant">--plugin-load-add</span><span class="token attr-value"><span class="token punctuation">=</span>y</span></code></pre>
   </div>
   <p>
    and are also equivalent to this option:
   </p>
   <div class="copytoclipboard-wrapper">
    <pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa95116440"><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-terminal"><span class="token constant">--plugin-load</span>=<span class="token atrule">"x;y"</span></code></pre>
   </div>
   <p>
    But these options:
   </p>
   <div class="copytoclipboard-wrapper">
    <pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa83782347"><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-terminal"><span class="token constant">--plugin-load-add</span><span class="token attr-value"><span class="token punctuation">=</span>y</span> <span class="token constant">--plugin-load</span><span class="token attr-value"><span class="token punctuation">=</span>x</span></code></pre>
   </div>
   <p>
    are equivalent to this option:
   </p>
   <div class="copytoclipboard-wrapper">
    <pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa69693156"><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-terminal"><span class="token constant">--plugin-load</span><span class="token attr-value"><span class="token punctuation">=</span>x</span></code></pre>
   </div>
   <h5>
    <a name="server-plugin-installing-install-plugin">
    </a>
    Plugins Installed with the INSTALL PLUGIN Statement
   </h5>
   <p>
    A plugin located in a plugin library file can be loaded at
        runtime with the
    <a class="link" href="install-plugin.html" title="15.7.4.4 INSTALL PLUGIN Statement">
     <code class="literal">
      INSTALL PLUGIN
     </code>
    </a>
    statement. The statement also registers the plugin in the
    <code class="literal">
     mysql.plugin
    </code>
    table to cause the server to
        load it on subsequent restarts. For this reason,
    <a class="link" href="install-plugin.html" title="15.7.4.4 INSTALL PLUGIN Statement">
     <code class="literal">
      INSTALL PLUGIN
     </code>
    </a>
    requires the
    <a class="link" href="privileges-provided.html#priv_insert">
     <code class="literal">
      INSERT
     </code>
    </a>
    privilege for the
    <code class="literal">
     mysql.plugin
    </code>
    table.
   </p>
   <p>
    The plugin library file base name 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>
   <p>
    Example: The
    <a class="link" href="server-options.html#option_mysqld_plugin-load-add">
     <code class="option">
      --plugin-load-add
     </code>
    </a>
    option installs a plugin at server startup. To install a plugin
        named
    <code class="literal">
     myplugin
    </code>
    from a plugin library file
        named
    <code class="filename">
     somepluglib.so
    </code>
    , use these lines in a
    <code class="filename">
     my.cnf
    </code>
    file:
   </p>
   <div class="copytoclipboard-wrapper">
    <pre class="programlisting language-ini"><div class="docs-select-all right" id="sa84251377"><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>myplugin=somepluglib.so</span></code></pre>
   </div>
   <p>
    In this case, the plugin is not registered in
    <code class="literal">
     mysql.plugin
    </code>
    . Restarting the server without
        the
    <a class="link" href="server-options.html#option_mysqld_plugin-load-add">
     <code class="option">
      --plugin-load-add
     </code>
    </a>
    option
        causes the plugin not to be loaded at startup.
   </p>
   <p>
    Alternatively, the
    <a class="link" href="install-plugin.html" title="15.7.4.4 INSTALL PLUGIN Statement">
     <code class="literal">
      INSTALL PLUGIN
     </code>
    </a>
    statement causes the server to load the plugin code from the
        library file at runtime:
   </p>
   <div class="copytoclipboard-wrapper">
    <pre class="programlisting one-line language-sql"><div class="docs-select-all right" id="sa62193990"><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> myplugin <span class="token keyword">SONAME</span> <span class="token string">'somepluglib.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>
    also causes
    <span class="quote">
     “
     <span class="quote">
      permanent
     </span>
     ”
    </span>
    plugin registration: The plugin is
        listed in the
    <code class="literal">
     mysql.plugin
    </code>
    table to ensure
        that the server loads it on subsequent restarts.
   </p>
   <p>
    Many plugins can be loaded either at server startup or at
        runtime. However, if a plugin is designed such that it must be
        loaded and initialized during server startup, attempts to load
        it at runtime using
    <a class="link" href="install-plugin.html" title="15.7.4.4 INSTALL PLUGIN Statement">
     <code class="literal">
      INSTALL
        PLUGIN
     </code>
    </a>
    produce an error:
   </p>
   <div class="copytoclipboard-wrapper">
    <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa13534682"><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">INSTALL</span> <span class="token keyword">PLUGIN</span> myplugin <span class="token keyword">SONAME</span> <span class="token string">'somepluglib.so'</span><span class="token punctuation">;</span>
<span class="token output">ERROR 1721 (HY000)<span class="token punctuation">:</span> Plugin 'myplugin' is marked as not dynamically
installable. You have to stop the server to install it.</span></code></pre>
   </div>
   <p>
    In this case, you must use
    <a class="link" href="server-options.html#option_mysqld_plugin-load">
     <code class="option">
      --plugin-load
     </code>
    </a>
    ,
    <a class="link" href="server-options.html#option_mysqld_plugin-load-add">
     <code class="option">
      --plugin-load-add
     </code>
    </a>
    , or
    <a class="link" href="server-options.html#option_mysqld_early-plugin-load">
     <code class="option">
      --early-plugin-load
     </code>
    </a>
    .
   </p>
   <p>
    If a plugin is named both using a
    <a class="link" href="server-options.html#option_mysqld_plugin-load">
     <code class="option">
      --plugin-load
     </code>
    </a>
    ,
    <a class="link" href="server-options.html#option_mysqld_plugin-load-add">
     <code class="option">
      --plugin-load-add
     </code>
    </a>
    , or
    <a class="link" href="server-options.html#option_mysqld_early-plugin-load">
     <code class="option">
      --early-plugin-load
     </code>
    </a>
    option and
        (as a result of an earlier
    <a class="link" href="install-plugin.html" title="15.7.4.4 INSTALL PLUGIN Statement">
     <code class="literal">
      INSTALL
        PLUGIN
     </code>
    </a>
    statement) in the
    <code class="literal">
     mysql.plugin
    </code>
    table, the server starts but
        writes these messages to the error log:
   </p>
   <div class="copytoclipboard-wrapper">
    <pre class="programlisting language-none"><div class="docs-select-all right" id="sa71322025"><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-none">[ERROR] Function '<em class="replaceable">plugin_name</em>' already exists
[Warning] Couldn't load plugin named '<em class="replaceable">plugin_name</em>'
with soname '<em class="replaceable">plugin_object_file</em>'.</code></pre>
   </div>
  </div>
  <div class="simplesect">
   <div class="titlepage">
    <div>
     <div class="simple">
      <h4 class="title">
       <a name="server-plugin-activating">
       </a>
       Controlling Plugin Activation State
      </h4>
     </div>
    </div>
   </div>
   <p>
    If the server knows about a plugin when it starts (for example,
        because the plugin is named using a
    <a class="link" href="server-options.html#option_mysqld_plugin-load-add">
     <code class="option">
      --plugin-load-add
     </code>
    </a>
    option or is
        registered in the
    <code class="literal">
     mysql.plugin
    </code>
    table), the
        server loads and enables the plugin by default. It is possible
        to control activation state for such a plugin using a
    <code class="literal">
     --
     <em class="replaceable">
      <code>
       plugin_name
      </code>
     </em>
     [=
     <em class="replaceable">
      <code>
       activation_state
      </code>
     </em>
     ]
    </code>
    startup option, where
    <em class="replaceable">
     <code>
      plugin_name
     </code>
    </em>
    is
        the name of the plugin to affect, such as
    <code class="literal">
     innodb
    </code>
    ,
    <code class="literal">
     csv
    </code>
    , or
    <code class="literal">
     validate_password
    </code>
    . As with other options,
        dashes and underscores are interchangeable in option names.
        Also, activation state values are not case-sensitive. For
        example,
    <code class="option">
     --my_plugin=ON
    </code>
    and
    <code class="option">
     --my-plugin=on
    </code>
    are equivalent.
   </p>
   <div class="itemizedlist">
    <ul class="itemizedlist" style="list-style-type: disc; ">
     <li class="listitem">
      <p>
       <code class="option">
        --
        <em class="replaceable">
         <code>
          plugin_name
         </code>
        </em>
        =OFF
       </code>
      </p>
      <a class="indexterm" name="idm46045256966784">
      </a>
      <a class="indexterm" name="idm46045256965312">
      </a>
      <p>
       Tells the server to disable the plugin. Using this option,
            you can disable, for example, the deprecated
       <code class="literal">
        mysql_native_password
       </code>
       plugin at server
            startup.
      </p>
     </li>
     <li class="listitem">
      <p>
       <code class="option">
        --
        <em class="replaceable">
         <code>
          plugin_name
         </code>
        </em>
        [=ON]
       </code>
      </p>
      <a class="indexterm" name="idm46045256960944">
      </a>
      <a class="indexterm" name="idm46045256959472">
      </a>
      <p>
       Tells the server to enable the plugin. (Specifying the
            option as
       <code class="option">
        --
        <em class="replaceable">
         <code>
          plugin_name
         </code>
        </em>
       </code>
       without a value has the same effect.) If the plugin fails to
            initialize, the server runs with the plugin disabled.
      </p>
     </li>
     <li class="listitem">
      <p>
       <code class="option">
        --
        <em class="replaceable">
         <code>
          plugin_name
         </code>
        </em>
        =FORCE
       </code>
      </p>
      <a class="indexterm" name="idm46045256955072">
      </a>
      <a class="indexterm" name="idm46045256953568">
      </a>
      <p>
       Tells the server to enable the plugin, but if plugin
            initialization fails, the server does not start. In other
            words, this option forces the server to run with the plugin
            enabled or not at all.
      </p>
     </li>
     <li class="listitem">
      <p>
       <code class="option">
        --
        <em class="replaceable">
         <code>
          plugin_name
         </code>
        </em>
        =FORCE_PLUS_PERMANENT
       </code>
      </p>
      <a class="indexterm" name="idm46045256949808">
      </a>
      <a class="indexterm" name="idm46045256948304">
      </a>
      <p>
       Like
       <code class="literal">
        FORCE
       </code>
       , but in addition prevents the
            plugin from being unloaded at runtime. If a user attempts to
            do so with
       <a class="link" href="uninstall-plugin.html" title="15.7.4.6 UNINSTALL PLUGIN Statement">
        <code class="literal">
         UNINSTALL PLUGIN
        </code>
       </a>
       ,
            an error occurs.
      </p>
     </li>
    </ul>
   </div>
   <p>
    Plugin activation states are visible in the
    <code class="literal">
     LOAD_OPTION
    </code>
    column of 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.
   </p>
   <p>
    Suppose that
    <code class="literal">
     CSV
    </code>
    ,
    <code class="literal">
     BLACKHOLE
    </code>
    , and
    <code class="literal">
     ARCHIVE
    </code>
    are
        built-in pluggable storage engines and that you want the server
        to load them at startup, subject to these conditions: The server
        is permitted to run if
    <code class="literal">
     CSV
    </code>
    initialization
        fails, must require that
    <code class="literal">
     BLACKHOLE
    </code>
    initialization succeeds, and should disable
    <code class="literal">
     ARCHIVE
    </code>
    . To accomplish that, use these lines
        in an option file:
   </p>
   <div class="copytoclipboard-wrapper">
    <pre class="programlisting language-ini"><div class="docs-select-all right" id="sa39602780"><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">csv</span><span class="token attr-value"><span class="token punctuation">=</span>ON</span>
<span class="token constant">blackhole</span><span class="token attr-value"><span class="token punctuation">=</span>FORCE</span>
<span class="token constant">archive</span><span class="token attr-value"><span class="token punctuation">=</span>OFF</span></code></pre>
   </div>
   <p>
    The
    <code class="option">
     --enable-
     <em class="replaceable">
      <code>
       plugin_name
      </code>
     </em>
    </code>
    option format is a synonym for
    <code class="option">
     --
     <em class="replaceable">
      <code>
       plugin_name
      </code>
     </em>
     =ON
    </code>
    .
        The
    <code class="option">
     --disable-
     <em class="replaceable">
      <code>
       plugin_name
      </code>
     </em>
    </code>
    and
    <code class="option">
     --skip-
     <em class="replaceable">
      <code>
       plugin_name
      </code>
     </em>
    </code>
    option formats are synonyms for
    <code class="option">
     --
     <em class="replaceable">
      <code>
       plugin_name
      </code>
     </em>
     =OFF
    </code>
    .
   </p>
   <p>
    If a plugin is disabled, either explicitly with
    <code class="literal">
     OFF
    </code>
    or implicitly because it was enabled with
    <code class="literal">
     ON
    </code>
    but fails to initialize, aspects of server
        operation requiring the plugin change. For example, if the
        plugin implements a storage engine, existing tables for the
        storage engine become inaccessible, and attempts to create new
        tables for the storage engine result in tables that use the
        default storage engine unless the
    <a class="link" href="sql-mode.html#sqlmode_no_engine_substitution">
     <code class="literal">
      NO_ENGINE_SUBSTITUTION
     </code>
    </a>
    SQL
        mode is enabled to cause an error to occur instead.
   </p>
   <p>
    Disabling a plugin may require adjustment to other options.
   </p>
  </div>
  <div class="simplesect">
   <div class="titlepage">
    <div>
     <div class="simple">
      <h4 class="title">
       <a name="server-plugin-uninstalling">
       </a>
       Uninstalling Plugins
      </h4>
     </div>
    </div>
   </div>
   <p>
    At runtime, the
    <a class="link" href="uninstall-plugin.html" title="15.7.4.6 UNINSTALL PLUGIN Statement">
     <code class="literal">
      UNINSTALL PLUGIN
     </code>
    </a>
    statement disables and uninstalls a plugin known to the server.
        The statement unloads the plugin and removes it from the
    <code class="literal">
     mysql.plugin
    </code>
    system table, if it is
        registered there. For this reason,
    <a class="link" href="uninstall-plugin.html" title="15.7.4.6 UNINSTALL PLUGIN Statement">
     <code class="literal">
      UNINSTALL PLUGIN
     </code>
    </a>
    statement
        requires the
    <a class="link" href="privileges-provided.html#priv_delete">
     <code class="literal">
      DELETE
     </code>
    </a>
    privilege for
        the
    <code class="literal">
     mysql.plugin
    </code>
    table. With the plugin no
        longer registered in the table, the server does not load the
        plugin during subsequent restarts.
   </p>
   <p>
    <a class="link" href="uninstall-plugin.html" title="15.7.4.6 UNINSTALL PLUGIN Statement">
     <code class="literal">
      UNINSTALL PLUGIN
     </code>
    </a>
    can unload a
        plugin regardless of whether it was loaded at runtime with
    <a class="link" href="install-plugin.html" title="15.7.4.4 INSTALL PLUGIN Statement">
     <code class="literal">
      INSTALL PLUGIN
     </code>
    </a>
    or at startup with
        a plugin-loading option, subject to these conditions:
   </p>
   <div class="itemizedlist">
    <ul class="itemizedlist" style="list-style-type: disc; ">
     <li class="listitem">
      <p>
       It cannot unload plugins that are built in to the server.
            These can be identified as those that have a library name of
       <code class="literal">
        NULL
       </code>
       in the output from 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
       <a class="link" href="show-plugins.html" title="15.7.7.27 SHOW PLUGINS Statement">
        <code class="literal">
         SHOW PLUGINS
        </code>
       </a>
       .
      </p>
     </li>
     <li class="listitem">
      <p>
       It cannot unload plugins for which the server was started
            with
       <code class="option">
        --
        <em class="replaceable">
         <code>
          plugin_name
         </code>
        </em>
        =FORCE_PLUS_PERMANENT
       </code>
       ,
            which prevents plugin unloading at runtime. These can be
            identified from the
       <code class="literal">
        LOAD_OPTION
       </code>
       column of
            the
       <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.
      </p>
     </li>
    </ul>
   </div>
   <p>
    To uninstall a plugin that currently is loaded at server startup
        with a plugin-loading option, use this procedure.
   </p>
   <div class="orderedlist">
    <ol class="orderedlist" type="1">
     <li class="listitem">
      <p>
       Remove from the
       <code class="filename">
        my.cnf
       </code>
       file any options
            and system variables related to the plugin. If any plugin
            system variables were persisted to the
       <code class="filename">
        mysqld-auto.cnf
       </code>
       file, remove them using
       <a class="link" href="reset-persist.html" title="15.7.8.7 RESET PERSIST Statement">
        <code class="literal">
         RESET PERSIST
         <em class="replaceable">
          <code>
           var_name
          </code>
         </em>
        </code>
       </a>
       for each one
            to remove it.
      </p>
     </li>
     <li class="listitem">
      <p>
       Restart the server.
      </p>
     </li>
     <li class="listitem">
      <p>
       Plugins normally are installed using either a plugin-loading
            option at startup or with
       <a class="link" href="install-plugin.html" title="15.7.4.4 INSTALL PLUGIN Statement">
        <code class="literal">
         INSTALL
            PLUGIN
        </code>
       </a>
       at runtime, but not both. However, removing
            options for a plugin from the
       <code class="filename">
        my.cnf
       </code>
       file may not be sufficient to uninstall it if at some point
       <a class="link" href="install-plugin.html" title="15.7.4.4 INSTALL PLUGIN Statement">
        <code class="literal">
         INSTALL PLUGIN
        </code>
       </a>
       has also been
            used. If the plugin still appears in the output from
       <a class="link" href="information-schema-plugins-table.html" title="28.3.22 The INFORMATION_SCHEMA PLUGINS Table">
        <code class="literal">
         PLUGINS
        </code>
       </a>
       or
       <a class="link" href="show-plugins.html" title="15.7.7.27 SHOW PLUGINS Statement">
        <code class="literal">
         SHOW PLUGINS
        </code>
       </a>
       , use
       <a class="link" href="uninstall-plugin.html" title="15.7.4.6 UNINSTALL PLUGIN Statement">
        <code class="literal">
         UNINSTALL PLUGIN
        </code>
       </a>
       to remove it
            from the
       <code class="literal">
        mysql.plugin
       </code>
       table. Then restart
            the server again.
      </p>
     </li>
    </ol>
   </div>
  </div>
  <div class="simplesect">
   <div class="titlepage">
    <div>
     <div class="simple">
      <h4 class="title">
       <a name="server-plugin-loadable-function-installing">
       </a>
       Plugins and Loadable Functions
      </h4>
     </div>
    </div>
   </div>
   <p>
    A plugin when installed may also automatically install related
        loadable functions. If so, the plugin when uninstalled also
        automatically uninstalls those functions.
   </p>
  </div>
 </div>
 <br/>
</div>
