<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h3 class="title">
      <a name="identifier-mapping">
      </a>
      11.2.4 Mapping of Identifiers to File Names
     </h3>
    </div>
   </div>
  </div>
  <p>
   There is a correspondence between database and table identifiers
        and names in the file system. For the basic structure, MySQL
        represents each database as a directory in the data directory,
        and depending upon the storage engine, each table may be
        represented by one or more files in the appropriate database
        directory.
  </p>
  <p>
   For the data and index files, the exact representation on disk
        is storage engine specific. These files may be stored in the
        database directory, or the information may be stored in a
        separate file.
   <code class="literal">
    InnoDB
   </code>
   data is stored in the
        InnoDB data files. If you are using tablespaces with
   <code class="literal">
    InnoDB
   </code>
   , then the specific tablespace files
        you create are used instead.
  </p>
  <p>
   Any character is legal in database or table identifiers except
        ASCII NUL (
   <code class="literal">
    X'00'
   </code>
   ). MySQL encodes any
        characters that are problematic in the corresponding file system
        objects when it creates database directories or table files:
  </p>
  <div class="itemizedlist">
   <ul class="itemizedlist" style="list-style-type: disc; ">
    <li class="listitem">
     <p>
      Basic Latin letters (
      <code class="literal">
       a..zA..Z
      </code>
      ), digits
            (
      <code class="literal">
       0..9
      </code>
      ) and underscore
            (
      <code class="literal">
       _
      </code>
      ) are encoded as is. Consequently,
            their case sensitivity directly depends on file system
            features.
     </p>
    </li>
    <li class="listitem">
     <p>
      All other national letters from alphabets that have
            uppercase/lowercase mapping are encoded as shown in the
            following table. Values in the Code Range column are UCS-2
            values.
     </p>
     <div class="informaltable">
      <table summary="The encoding for national letters from alphabets that have uppercase/lowercase mapping, excluding basic Latin letters (a..zA..Z), digits (0..9) and underscore (_), which are encoded as is.">
       <colgroup>
        <col style="width: 15%"/>
        <col style="width: 15%"/>
        <col style="width: 15%"/>
        <col style="width: 15%"/>
        <col style="width: 15%"/>
        <col style="width: 25%"/>
       </colgroup>
       <thead>
        <tr>
         <th scope="col">
          Code Range
         </th>
         <th scope="col">
          Pattern
         </th>
         <th scope="col">
          Number
         </th>
         <th scope="col">
          Used
         </th>
         <th scope="col">
          Unused
         </th>
         <th scope="col">
          Blocks
         </th>
        </tr>
       </thead>
       <tbody>
        <tr>
         <th scope="row">
          00C0..017F
         </th>
         <td>
          [@][0..4][g..z]
         </td>
         <td>
          5*20= 100
         </td>
         <td>
          97
         </td>
         <td>
          3
         </td>
         <td>
          Latin-1 Supplement + Latin Extended-A
         </td>
        </tr>
        <tr>
         <th scope="row">
          0370..03FF
         </th>
         <td>
          [@][5..9][g..z]
         </td>
         <td>
          5*20= 100
         </td>
         <td>
          88
         </td>
         <td>
          12
         </td>
         <td>
          Greek and Coptic
         </td>
        </tr>
        <tr>
         <th scope="row">
          0400..052F
         </th>
         <td>
          [@][g..z][0..6]
         </td>
         <td>
          20*7= 140
         </td>
         <td>
          137
         </td>
         <td>
          3
         </td>
         <td>
          Cyrillic + Cyrillic Supplement
         </td>
        </tr>
        <tr>
         <th scope="row">
          0530..058F
         </th>
         <td>
          [@][g..z][7..8]
         </td>
         <td>
          20*2= 40
         </td>
         <td>
          38
         </td>
         <td>
          2
         </td>
         <td>
          Armenian
         </td>
        </tr>
        <tr>
         <th scope="row">
          2160..217F
         </th>
         <td>
          [@][g..z][9]
         </td>
         <td>
          20*1= 20
         </td>
         <td>
          16
         </td>
         <td>
          4
         </td>
         <td>
          Number Forms
         </td>
        </tr>
        <tr>
         <th scope="row">
          0180..02AF
         </th>
         <td>
          [@][g..z][a..k]
         </td>
         <td>
          20*11=220
         </td>
         <td>
          203
         </td>
         <td>
          17
         </td>
         <td>
          Latin Extended-B + IPA Extensions
         </td>
        </tr>
        <tr>
         <th scope="row">
          1E00..1EFF
         </th>
         <td>
          [@][g..z][l..r]
         </td>
         <td>
          20*7= 140
         </td>
         <td>
          136
         </td>
         <td>
          4
         </td>
         <td>
          Latin Extended Additional
         </td>
        </tr>
        <tr>
         <th scope="row">
          1F00..1FFF
         </th>
         <td>
          [@][g..z][s..z]
         </td>
         <td>
          20*8= 160
         </td>
         <td>
          144
         </td>
         <td>
          16
         </td>
         <td>
          Greek Extended
         </td>
        </tr>
        <tr>
         <th scope="row">
          .... ....
         </th>
         <td>
          [@][a..f][g..z]
         </td>
         <td>
          6*20= 120
         </td>
         <td>
          0
         </td>
         <td>
          120
         </td>
         <td>
          RESERVED
         </td>
        </tr>
        <tr>
         <th scope="row">
          24B6..24E9
         </th>
         <td>
          [@][@][a..z]
         </td>
         <td>
          26
         </td>
         <td>
          26
         </td>
         <td>
          0
         </td>
         <td>
          Enclosed Alphanumerics
         </td>
        </tr>
        <tr>
         <th scope="row">
          FF21..FF5A
         </th>
         <td>
          [@][a..z][@]
         </td>
         <td>
          26
         </td>
         <td>
          26
         </td>
         <td>
          0
         </td>
         <td>
          Halfwidth and Fullwidth forms
         </td>
        </tr>
       </tbody>
      </table>
     </div>
     <div class="informaltable">
      <table cellpadding="0" cellspacing="0" style="position: fixed; top: 0px; display: none; left: 431px; width: 709px;">
       <thead>
        <tr>
         <th scope="col" style="width: 106.188px;">
          Code Range
         </th>
         <th scope="col" style="width: 106.188px;">
          Pattern
         </th>
         <th scope="col" style="width: 106.188px;">
          Number
         </th>
         <th scope="col" style="width: 106.188px;">
          Used
         </th>
         <th scope="col" style="width: 106.188px;">
          Unused
         </th>
         <th scope="col" style="width: 177.062px;">
          Blocks
         </th>
        </tr>
       </thead>
      </table>
     </div>
     <p>
      One of the bytes in the sequence encodes lettercase. For
            example:
      <code class="literal">
       LATIN CAPITAL LETTER A WITH
            GRAVE
      </code>
      is encoded as
      <code class="literal">
       @0G
      </code>
      ,
            whereas
      <code class="literal">
       LATIN SMALL LETTER A WITH GRAVE
      </code>
      is encoded as
      <code class="literal">
       @0g
      </code>
      . Here the third byte
            (
      <code class="literal">
       G
      </code>
      or
      <code class="literal">
       g
      </code>
      ) indicates
            lettercase. (On a case-insensitive file system, both letters
            are treated as the same.)
     </p>
     <p>
      For some blocks, such as Cyrillic, the second byte
            determines lettercase. For other blocks, such as Latin1
            Supplement, the third byte determines lettercase. If two
            bytes in the sequence are letters (as in Greek Extended),
            the leftmost letter character stands for lettercase. All
            other letter bytes must be in lowercase.
     </p>
    </li>
    <li class="listitem">
     <p>
      All nonletter characters except underscore
            (
      <code class="literal">
       _
      </code>
      ), as well as letters from alphabets
            that do not have uppercase/lowercase mapping (such as
            Hebrew) are encoded using hexadecimal representation using
            lowercase letters for hexadecimal digits
      <code class="literal">
       a..f
      </code>
      :
     </p>
     <div class="copytoclipboard-wrapper">
      <pre class="programlisting language-clike"><div class="docs-select-all right" id="sa71996784"><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-clike"><span class="token number">0x003F</span> <span class="token operator">-</span><span class="token operator">&gt;</span> @003f
<span class="token number">0xFFFF</span> <span class="token operator">-</span><span class="token operator">&gt;</span> @ffff</code></pre>
     </div>
     <p>
      The hexadecimal values correspond to character values in the
      <code class="literal">
       ucs2
      </code>
      double-byte character set.
     </p>
    </li>
   </ul>
  </div>
  <p>
   On Windows, some names such as
   <code class="literal">
    nul
   </code>
   ,
   <code class="literal">
    prn
   </code>
   , and
   <code class="literal">
    aux
   </code>
   are encoded
        by appending
   <code class="literal">
    @@@
   </code>
   to the name when the server
        creates the corresponding file or directory. This occurs on all
        platforms for portability of the corresponding database object
        between platforms.
  </p>
  <p>
   The following names are reserved and appended with
   <code class="literal">
    @@@
   </code>
   if used in schema or table names:
  </p>
  <div class="itemizedlist">
   <ul class="itemizedlist" style="list-style-type: disc; ">
    <li class="listitem">
     <p>
      CON
     </p>
    </li>
    <li class="listitem">
     <p>
      PRN
     </p>
    </li>
    <li class="listitem">
     <p>
      AUX
     </p>
    </li>
    <li class="listitem">
     <p>
      NUL
     </p>
    </li>
    <li class="listitem">
     <p>
      COM1 through COM9
     </p>
    </li>
    <li class="listitem">
     <p>
      LPT1 through LPT9
     </p>
    </li>
   </ul>
  </div>
  <p>
   CLOCK$ is also a member of this group of reserved names, but is
        not appended with
   <code class="literal">
    @@@
   </code>
   , but
   <code class="literal">
    @0024
   </code>
   instead. That is, if CLOCK$ is used as
        a schema or table name, it is written to the file system as
   <code class="filename">
    CLOCK@0024
   </code>
   . The same is true for any use of
        $ (dollar sign) in a schema or table name; it is replaced with
   <code class="filename">
    @0024
   </code>
   on the filesystem.
  </p>
  <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
   <div class="admon-title">
    Note
   </div>
   <p>
    These names are also written to
    <a class="link" href="information-schema-innodb-tables-table.html" title="28.4.23 The INFORMATION_SCHEMA INNODB_TABLES Table">
     <code class="literal">
      INNODB_TABLES
     </code>
    </a>
    in their appended
          forms, but are written to
    <a class="link" href="information-schema-tables-table.html" title="28.3.38 The INFORMATION_SCHEMA TABLES Table">
     <code class="literal">
      TABLES
     </code>
    </a>
    in their unappended form, as entered by the user.
   </p>
  </div>
 </div>
 <br/>
</div>
