<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h3 class="title">
      <a name="pluggable-storage">
      </a>
      18.11.1 Pluggable Storage Engine Architecture
     </h3>
    </div>
   </div>
  </div>
  <p>
   MySQL Server uses a pluggable storage engine architecture that
        enables storage engines to be loaded into and unloaded from a
        running MySQL server.
  </p>
  <p>
   <span class="bold">
    <strong>
     Plugging in a Storage Engine
    </strong>
   </span>
  </p>
  <p>
   Before a storage engine can be used, the storage engine plugin
        shared library must be loaded into MySQL using the
   <a class="link" href="install-plugin.html" title="15.7.4.4 INSTALL PLUGIN Statement">
    <code class="literal">
     INSTALL PLUGIN
    </code>
   </a>
   statement. For
        example, if the
   <code class="literal">
    EXAMPLE
   </code>
   engine plugin is
        named
   <code class="literal">
    example
   </code>
   and the shared library is named
   <code class="filename">
    ha_example.so
   </code>
   , you load it with the
        following statement:
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting one-line language-sql"><div class="docs-select-all right" id="sa59092605"><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> example <span class="token keyword">SONAME</span> <span class="token string">'ha_example.so'</span><span class="token punctuation">;</span></code></pre>
  </div>
  <p>
   To install a pluggable storage engine, the plugin file must be
        located in the MySQL plugin directory, and the user issuing the
   <a class="link" href="install-plugin.html" title="15.7.4.4 INSTALL PLUGIN Statement">
    <code class="literal">
     INSTALL PLUGIN
    </code>
   </a>
   statement must
        have
   <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 shared library must be located in the MySQL server plugin
        directory, the location of which is given by the
   <a class="link" href="server-system-variables.html#sysvar_plugin_dir">
    <code class="literal">
     plugin_dir
    </code>
   </a>
   system variable.
  </p>
  <p>
   <span class="bold">
    <strong>
     Unplugging a Storage Engine
    </strong>
   </span>
  </p>
  <p>
   To unplug a storage engine, use the
   <a class="link" href="uninstall-plugin.html" title="15.7.4.6 UNINSTALL PLUGIN Statement">
    <code class="literal">
     UNINSTALL PLUGIN
    </code>
   </a>
   statement:
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting one-line language-sql"><div class="docs-select-all right" id="sa98893361"><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">UNINSTALL</span> <span class="token keyword">PLUGIN</span> example<span class="token punctuation">;</span></code></pre>
  </div>
  <p>
   If you unplug a storage engine that is needed by existing
        tables, those tables become inaccessible, but are still present
        on disk (where applicable). Ensure that there are no tables
        using a storage engine before you unplug the storage engine.
  </p>
 </div>
 <br/>
</div>
