Character Sets and Collations in General 10.13.1 Character Definition Arrays ....................................................................................... 1990 10.13.2 String Collating Support for Complex Character Sets .................................................. 1991 10.13.3 Multi-Byte Character Support for Complex Character Sets .......................................... 1991 10.14 Adding a Collation to a Character Set .................................................................................. 1991 10.14.1 Collation Implementation Types ................................................................................. 1992 10.14.2 Choosing a Collation ID ............................................................................................ 1995 10.14.3 Adding a Simple Collation to an 8-Bit Character Set ................................................... 1996 10.14.4 Adding a UCA Collation to a Unicode Character Set .................................................. 1997 10.15 Character Set Configuration ................................................................................................. 2004 10.16 MySQL Server Locale Support ............................................................................................ 2005 MySQL includes character set support that enables you to store data using a variety of character sets and perform comparisons according to a variety of collations. The default MySQL server character set and collation are  utf8mb4  and  utf8mb4_0900_ai_ci , but you can specify character sets at the server, database, table, column, and string literal levels. This chapter discusses the following topics: 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’ll need to indicate which one. For example, to use the  utf8  Unicode character set, issue this statement after connecting to the server: SET NAMES ’utf8’; For more information about configuring character sets for application use and character set-related issues in client/server communication, see Section 10.5, “Configuring Application Character Set and Collation” , and Section 10.4, “Connection Character Sets and Collations” . A  character set  is a set of symbols and encodings. A  collation  is a set of rules for comparing characters in a character set. Let’s make the distinction clear with an example of an imaginary character set. Suppose that we have an alphabet with four letters:  A ,  B ,  a ,  b . We give each letter a number:  A  = 0,  B  = 1, a  = 2,  b  = 3. The letter  A  is a symbol, the number 0 is the  encoding  for  A , and the combination of all four letters and their encodings is a  character set . Suppose that we want to compare two string values,  A  and  B . The simplest way to do this is to look at the encodings: 0 for  A  and 1 for  B . Because 0 is less than 1, we say  A  is less than  B . What we’ve just done is apply a collation to our character set. The collation is a set of rules (only one rule in this case): “compare the encodings.”  We call this simplest of all possible collations a  binary  collation. 1926 10.1 Character Sets and Collations in General •What are character sets and collations? •The multiple-level default system for character set assignment. •Syntax for specifying character sets and collations. •Affected functions and operations. •Unicode support. •The character sets and collations that are available, with notes. •Selecting the language for error messages. •Selecting the locale for day and month names.