<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h3 class="title">
      <a name="symbolic-links">
      </a>
      10.12.2 Using Symbolic Links
     </h3>
    </div>
   </div>
  </div>
  <div class="toc">
   <dl class="toc">
    <dt>
     <span class="section">
      <a href="symbolic-links-to-databases.html">
       10.12.2.1 Using Symbolic Links for Databases on Unix
      </a>
     </span>
    </dt>
    <dt>
     <span class="section">
      <a href="symbolic-links-to-tables.html">
       10.12.2.2 Using Symbolic Links for MyISAM Tables on Unix
      </a>
     </span>
    </dt>
    <dt>
     <span class="section">
      <a href="windows-symbolic-links.html">
       10.12.2.3 Using Symbolic Links for Databases on Windows
      </a>
     </span>
    </dt>
   </dl>
  </div>
  <a class="indexterm" name="idm46045222487280">
  </a>
  <a class="indexterm" name="idm46045222486208">
  </a>
  <p>
   You can move databases or tables from the database directory to
        other locations and replace them with symbolic links to the new
        locations. You might want to do this, for example, to move a
        database to a file system with more free space or increase the
        speed of your system by spreading your tables to different
        disks.
  </p>
  <p>
   For
   <code class="literal">
    InnoDB
   </code>
   tables, use the
   <code class="literal">
    DATA
        DIRECTORY
   </code>
   clause of the
   <a class="link" href="create-table.html" title="15.1.20 CREATE TABLE Statement">
    <code class="literal">
     CREATE
        TABLE
    </code>
   </a>
   statement instead of symbolic links, as
        explained in
   <a class="xref" href="innodb-create-table-external.html" title="17.6.1.2 Creating Tables Externally">
    Section 17.6.1.2, “Creating Tables Externally”
   </a>
   .
        This new feature is a supported, cross-platform technique.
  </p>
  <p>
   The recommended way to do this is to symlink entire database
        directories to a different disk. Symlink
   <code class="literal">
    MyISAM
   </code>
   tables only as a last resort.
  </p>
  <p>
   To determine the location of your data directory, use this
        statement:
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting one-line language-sql"><div class="docs-select-all right" id="sa86653043"><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">SHOW</span> <span class="token keyword">VARIABLES</span> <span class="token operator">LIKE</span> <span class="token string">'datadir'</span><span class="token punctuation">;</span></code></pre>
  </div>
 </div>
 <br/>
</div>
