<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h2 class="title">
      <a name="charset-syntax">
      </a>
      12.3 Specifying Character Sets and Collations
     </h2>
    </div>
   </div>
  </div>
  <div class="toc">
   <dl class="toc">
    <dt>
     <span class="section">
      <a href="charset-collation-names.html">
       12.3.1 Collation Naming Conventions
      </a>
     </span>
    </dt>
    <dt>
     <span class="section">
      <a href="charset-server.html">
       12.3.2 Server Character Set and Collation
      </a>
     </span>
    </dt>
    <dt>
     <span class="section">
      <a href="charset-database.html">
       12.3.3 Database Character Set and Collation
      </a>
     </span>
    </dt>
    <dt>
     <span class="section">
      <a href="charset-table.html">
       12.3.4 Table Character Set and Collation
      </a>
     </span>
    </dt>
    <dt>
     <span class="section">
      <a href="charset-column.html">
       12.3.5 Column Character Set and Collation
      </a>
     </span>
    </dt>
    <dt>
     <span class="section">
      <a href="charset-literal.html">
       12.3.6 Character String Literal Character Set and Collation
      </a>
     </span>
    </dt>
    <dt>
     <span class="section">
      <a href="charset-national.html">
       12.3.7 The National Character Set
      </a>
     </span>
    </dt>
    <dt>
     <span class="section">
      <a href="charset-introducer.html">
       12.3.8 Character Set Introducers
      </a>
     </span>
    </dt>
    <dt>
     <span class="section">
      <a href="charset-examples.html">
       12.3.9 Examples of Character Set and Collation Assignment
      </a>
     </span>
    </dt>
    <dt>
     <span class="section">
      <a href="charset-compatibility.html">
       12.3.10 Compatibility with Other DBMSs
      </a>
     </span>
    </dt>
   </dl>
  </div>
  <p>
   There are default settings for character sets and collations at
      four levels: server, database, table, and column. The description
      in the following sections may appear complex, but it has been
      found in practice that multiple-level defaulting leads to natural
      and obvious results.
  </p>
  <p>
   <code class="literal">
    CHARACTER SET
   </code>
   is used in clauses that specify a
      character set.
   <code class="literal">
    CHARSET
   </code>
   can be used as a synonym
      for
   <code class="literal">
    CHARACTER SET
   </code>
   .
  </p>
  <p>
   Character set issues affect not only data storage, but also
      communication between client programs and the MySQL server. If you
      want the client program to communicate with the server using a
      character set different from the default, you need to indicate
      which one. For example, to use the
   <code class="literal">
    latin1
   </code>
   Unicode character set, issue this statement after connecting to
      the server:
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting one-line language-sql"><div class="docs-select-all right" id="sa64069952"><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">SET</span> <span class="token keyword">NAMES</span> <span class="token string">'latin1'</span><span class="token punctuation">;</span></code></pre>
  </div>
  <p>
   For more information about character set-related issues in
      client/server communication, see
   <a class="xref" href="charset-connection.html" title="12.4 Connection Character Sets and Collations">
    Section 12.4, “Connection Character Sets and Collations”
   </a>
   .
  </p>
 </div>
 <br/>
</div>
