<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h3 class="title">
      <a name="identifier-length">
      </a>
      11.2.1 Identifier Length Limits
     </h3>
    </div>
   </div>
  </div>
  <p>
   The following table describes the maximum length for each type
        of identifier.
  </p>
  <div class="informaltable">
   <table summary="The maximum length for each type of MySQL object identifier.">
    <colgroup>
     <col style="width: 15%"/>
     <col style="width: 15%"/>
    </colgroup>
    <thead>
     <tr>
      <th>
       Identifier Type
      </th>
      <th>
       Maximum Length (characters)
      </th>
     </tr>
    </thead>
    <tbody>
     <tr>
      <td>
       Database
      </td>
      <td>
       64
      </td>
     </tr>
     <tr>
      <td>
       Table
      </td>
      <td>
       64
      </td>
     </tr>
     <tr>
      <td>
       Column
      </td>
      <td>
       64
      </td>
     </tr>
     <tr>
      <td>
       Index
      </td>
      <td>
       64
      </td>
     </tr>
     <tr>
      <td>
       Constraint
      </td>
      <td>
       64
      </td>
     </tr>
     <tr>
      <td>
       Stored Program
      </td>
      <td>
       64
      </td>
     </tr>
     <tr>
      <td>
       View
      </td>
      <td>
       64
      </td>
     </tr>
     <tr>
      <td>
       Tablespace
      </td>
      <td>
       64
      </td>
     </tr>
     <tr>
      <td>
       Server
      </td>
      <td>
       64
      </td>
     </tr>
     <tr>
      <td>
       Log File Group
      </td>
      <td>
       64
      </td>
     </tr>
     <tr>
      <td>
       Alias
      </td>
      <td>
       256 (see exception following table)
      </td>
     </tr>
     <tr>
      <td>
       Compound Statement Label
      </td>
      <td>
       16
      </td>
     </tr>
     <tr>
      <td>
       User-Defined Variable
      </td>
      <td>
       64
      </td>
     </tr>
     <tr>
      <td>
       Resource Group
      </td>
      <td>
       64
      </td>
     </tr>
    </tbody>
   </table>
  </div>
  <div class="informaltable">
   <table cellpadding="0" cellspacing="0" style="position: fixed; top: 0px; display: none; left: 401px; width: 739px;">
    <thead>
     <tr>
      <th style="width: 369px;">
       Identifier Type
      </th>
      <th style="width: 369px;">
       Maximum Length (characters)
      </th>
     </tr>
    </thead>
   </table>
  </div>
  <p>
   Aliases for column names in
   <a class="link" href="create-view.html" title="15.1.23 CREATE VIEW Statement">
    <code class="literal">
     CREATE
        VIEW
    </code>
   </a>
   statements are checked against the maximum column
        length of 64 characters (not the maximum alias length of 256
        characters).
  </p>
  <p>
   For constraint definitions that include no constraint name, the
        server internally generates a name derived from the associated
        table name. For example, internally generated foreign key and
   <code class="literal">
    CHECK
   </code>
   constraint names consist of the table
        name plus
   <code class="literal">
    _ibfk_
   </code>
   or
   <code class="literal">
    _chk_
   </code>
   and a number. If the table name is close to the length limit for
        constraint names, the additional characters required for the
        constraint name may cause that name to exceed the limit,
        resulting in an error.
  </p>
  <p>
   Identifiers are stored using Unicode (UTF-8). This applies to
        identifiers in table definitions and to identifiers stored in
        the grant tables in the
   <code class="literal">
    mysql
   </code>
   database. The
        sizes of the identifier string columns in the grant tables are
        measured in characters. You can use multibyte characters without
        reducing the number of characters permitted for values stored in
        these columns.
  </p>
  <p>
   Values such as user name and host names in MySQL account names
        are strings rather than identifiers. For information about the
        maximum length of such values as stored in grant tables, see
   <a class="xref" href="grant-tables.html#grant-tables-scope-column-properties" title="Grant Table Scope Column Properties">
    Grant Table Scope Column Properties
   </a>
   .
  </p>
 </div>
 <br/>
</div>
