<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h4 class="title">
      <a name="rewriter-query-rewrite-plugin-installation">
      </a>
      7.6.4.1 Installing or Uninstalling the Rewriter Query Rewrite Plugin
     </h4>
    </div>
   </div>
  </div>
  <a class="indexterm" name="idm46045256618256">
  </a>
  <a class="indexterm" name="idm46045256616752">
  </a>
  <a class="indexterm" name="idm46045256615248">
  </a>
  <a class="indexterm" name="idm46045256613744">
  </a>
  <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
   <div class="admon-title">
    Note
   </div>
   <p>
    If installed, the
    <code class="literal">
     Rewriter
    </code>
    plugin involves
          some overhead even when disabled. To avoid this overhead, do
          not install the plugin unless you plan to use it.
   </p>
  </div>
  <p>
   To install or uninstall the
   <code class="literal">
    Rewriter
   </code>
   query
        rewrite plugin, choose the appropriate script located in the
   <code class="filename">
    share
   </code>
   directory of your MySQL installation:
  </p>
  <div class="itemizedlist">
   <ul class="itemizedlist" style="list-style-type: disc; ">
    <li class="listitem">
     <p>
      <code class="filename">
       install_rewriter.sql
      </code>
      : Choose this
            script to install the
      <code class="literal">
       Rewriter
      </code>
      plugin and
            its associated elements.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="filename">
       uninstall_rewriter.sql
      </code>
      : Choose this
            script to uninstall the
      <code class="literal">
       Rewriter
      </code>
      plugin
            and its associated elements.
     </p>
    </li>
   </ul>
  </div>
  <p>
   Run the chosen script as follows:
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting language-terminal"><div class="docs-select-all right" id="sa48340832"><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 prompt">$&gt; </span><span class="token command">mysql</span> <span class="token property">-u</span> root <span class="token property">-p</span> &lt; install_rewriter<span class="token punctuation">.</span>sql
Enter password<span class="token punctuation">:</span> <span class="token punctuation"></span><em class="replaceable"><span class="token punctuation">(</span>enter root password here<span class="token punctuation">)</span></em><span class="token punctuation"></span></code></pre>
  </div>
  <p>
   The example here uses the
   <code class="filename">
    install_rewriter.sql
   </code>
   installation script.
        Substitute
   <code class="filename">
    uninstall_rewriter.sql
   </code>
   if you
        are uninstalling the plugin.
  </p>
  <p>
   Running an installation script should install and enable the
        plugin. To verify that, connect to the server and execute this
        statement:
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa99263426"><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">SHOW</span> <span class="token keyword">GLOBAL</span> <span class="token keyword">VARIABLES</span> <span class="token operator">LIKE</span> <span class="token string">'rewriter_enabled'</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>
<span class="token output"><span class="token punctuation">|</span> Variable_name    <span class="token punctuation">|</span> Value <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>
<span class="token output"><span class="token punctuation">|</span> rewriter_enabled <span class="token punctuation">|</span> ON    <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></code></pre>
  </div>
  <p>
   For usage instructions, see
   <a class="xref" href="rewriter-query-rewrite-plugin-usage.html" title="7.6.4.2 Using the Rewriter Query Rewrite Plugin">
    Section 7.6.4.2, “Using the Rewriter Query Rewrite Plugin”
   </a>
   . For
        reference information, see
   <a class="xref" href="rewriter-query-rewrite-plugin-reference.html" title="7.6.4.3 Rewriter Query Rewrite Plugin Reference">
    Section 7.6.4.3, “Rewriter Query Rewrite Plugin Reference”
   </a>
   .
  </p>
 </div>
 <br/>
</div>
