<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h4 class="title">
      <a name="create-table-files">
      </a>
      15.1.20.1 Files Created by CREATE TABLE
     </h4>
    </div>
   </div>
  </div>
  <a class="indexterm" name="idm46045185422000">
  </a>
  <a class="indexterm" name="idm46045185420544">
  </a>
  <a class="indexterm" name="idm46045185419472">
  </a>
  <a class="indexterm" name="idm46045185418400">
  </a>
  <a class="indexterm" name="idm46045185417328">
  </a>
  <p>
   For an
   <code class="literal">
    InnoDB
   </code>
   table created in a
        file-per-table tablespace or general tablespace, table data and
        associated indexes are stored in a
   <a class="link" href="glossary.html#glos_ibd_file" title=".ibd file">
    .ibd file
   </a>
   in the database
        directory. When an
   <code class="literal">
    InnoDB
   </code>
   table is created in
        the system tablespace, table data and indexes are stored in the
   <a class="link" href="glossary.html#glos_ibdata_file" title="ibdata file">
    ibdata* files
   </a>
   that
        represent the system tablespace. The
   <a class="link" href="innodb-parameters.html#sysvar_innodb_file_per_table">
    <code class="literal">
     innodb_file_per_table
    </code>
   </a>
   option
        controls whether tables are created in file-per-table
        tablespaces or the system tablespace, by default. The
   <code class="literal">
    TABLESPACE
   </code>
   option can be used to place a
        table in a file-per-table tablespace, general tablespace, or the
        system tablespace, regardless of the
   <a class="link" href="innodb-parameters.html#sysvar_innodb_file_per_table">
    <code class="literal">
     innodb_file_per_table
    </code>
   </a>
   setting.
  </p>
  <p>
   For
   <code class="literal">
    MyISAM
   </code>
   tables, the storage engine creates
        data and index files. Thus, for each
   <code class="literal">
    MyISAM
   </code>
   table
   <em class="replaceable">
    <code>
     tbl_name
    </code>
   </em>
   , there are two disk
        files.
  </p>
  <div class="informaltable">
   <table summary="The purpose of MyISAM table tbl_name disk files.">
    <colgroup>
     <col style="width: 30%"/>
     <col style="width: 70%"/>
    </colgroup>
    <thead>
     <tr>
      <th>
       File
      </th>
      <th>
       Purpose
      </th>
     </tr>
    </thead>
    <tbody>
     <tr>
      <td>
       <code class="filename">
        <em class="replaceable">
         <code>
          tbl_name
         </code>
        </em>
        .MYD
       </code>
      </td>
      <td>
       Data file
      </td>
     </tr>
     <tr>
      <td>
       <code class="filename">
        <em class="replaceable">
         <code>
          tbl_name
         </code>
        </em>
        .MYI
       </code>
      </td>
      <td>
       Index file
      </td>
     </tr>
    </tbody>
   </table>
  </div>
  <p>
   <a class="xref" href="storage-engines.html" title="Chapter 18 Alternative Storage Engines">
    Chapter 18,
    <i>
     Alternative Storage Engines
    </i>
   </a>
   , describes what files each
        storage engine creates to represent tables. If a table name
        contains special characters, the names for the table files
        contain encoded versions of those characters as described in
   <a class="xref" href="identifier-mapping.html" title="11.2.4 Mapping of Identifiers to File Names">
    Section 11.2.4, “Mapping of Identifiers to File Names”
   </a>
   .
  </p>
 </div>
 <br/>
</div>
