<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h3 class="title">
      <a name="component-loading">
      </a>
      7.5.1 Installing and Uninstalling Components
     </h3>
    </div>
   </div>
  </div>
  <a class="indexterm" name="idm46045257338080">
  </a>
  <a class="indexterm" name="idm46045257337040">
  </a>
  <a class="indexterm" name="idm46045257335552">
  </a>
  <a class="indexterm" name="idm46045257334480">
  </a>
  <p>
   Components must be loaded into the server before they can be used.
      MySQL supports manual component loading at runtime and automatic
      loading during server startup.
  </p>
  <p>
   While a component is loaded, information about it is available as
      described in
   <a class="xref" href="obtaining-component-information.html" title="7.5.2 Obtaining Component Information">
    Section 7.5.2, “Obtaining Component Information”
   </a>
   .
  </p>
  <p>
   The
   <a class="link" href="install-component.html" title="15.7.4.3 INSTALL COMPONENT Statement">
    <code class="literal">
     INSTALL COMPONENT
    </code>
   </a>
   and
   <a class="link" href="uninstall-component.html" title="15.7.4.5 UNINSTALL COMPONENT Statement">
    <code class="literal">
     UNINSTALL COMPONENT
    </code>
   </a>
   SQL statements
      enable component loading and unloading. For example:
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa88619965"><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">COMPONENT</span> <span class="token string">'file://component_validate_password'</span><span class="token punctuation">;</span>
<span class="token keyword">UNINSTALL</span> <span class="token keyword">COMPONENT</span> <span class="token string">'file://component_validate_password'</span><span class="token punctuation">;</span></code></pre>
  </div>
  <p>
   A loader service handles component loading and unloading, and also
      registers loaded components in the
   <code class="literal">
    mysql.component
   </code>
   system table.
  </p>
  <p>
   The SQL statements for component manipulation affect server
      operation and the
   <code class="literal">
    mysql.component
   </code>
   system table
      as follows:
  </p>
  <div class="itemizedlist">
   <ul class="itemizedlist" style="list-style-type: disc; ">
    <li class="listitem">
     <p>
      <a class="link" href="install-component.html" title="15.7.4.3 INSTALL COMPONENT Statement">
       <code class="literal">
        INSTALL COMPONENT
       </code>
      </a>
      loads
          components into the server. The components become active
          immediately. The loader service also registers loaded
          components in the
      <code class="literal">
       mysql.component
      </code>
      system
          table. For subsequent server restarts, the loader service
          loads any components listed in
      <code class="literal">
       mysql.component
      </code>
      during the startup
          sequence. This occurs even 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. The
          optional
      <code class="literal">
       SET
      </code>
      clause permits setting
          component system-variable values when you install components.
     </p>
    </li>
    <li class="listitem">
     <p>
      <a class="link" href="uninstall-component.html" title="15.7.4.5 UNINSTALL COMPONENT Statement">
       <code class="literal">
        UNINSTALL COMPONENT
       </code>
      </a>
      deactivates
          components and unloads them from the server. The loader
          service also unregisters the components from the
      <code class="literal">
       mysql.component
      </code>
      system table so that the
          server no longer loads them during its startup sequence for
          subsequent restarts.
     </p>
    </li>
   </ul>
  </div>
  <p>
   Compared to the corresponding
   <a class="link" href="install-plugin.html" title="15.7.4.4 INSTALL PLUGIN Statement">
    <code class="literal">
     INSTALL
      PLUGIN
    </code>
   </a>
   statement for server plugins, the
   <a class="link" href="install-component.html" title="15.7.4.3 INSTALL COMPONENT Statement">
    <code class="literal">
     INSTALL COMPONENT
    </code>
   </a>
   statement for
      components offers the significant advantage that it is not
      necessary to know any platform-specific file name suffix for
      naming the component. This means that a given
   <a class="link" href="install-component.html" title="15.7.4.3 INSTALL COMPONENT Statement">
    <code class="literal">
     INSTALL COMPONENT
    </code>
   </a>
   statement can be
      executed uniformly across platforms.
  </p>
  <p>
   A component when installed may also automatically install related
      loadable functions. If so, the component when uninstalled also
      automatically uninstalls those functions.
  </p>
 </div>
 <br/>
</div>
