SHOW CHARACTER SET

This MySQL statement will show all of the character sets (e.g., latin1, utf8) installed on the server.

Syntax

Below is the syntax for this command. Text within square brackets (i.e, [ and ] ) are optional. Choices are separated by bars (i.e, | ). Ellipses preceded by a comma indicates a repeating pattern. Ellipses before or after syntax are used to highlight a relevant except from the larger syntax. Text displayed in italic letters represent text that should be replaced with the specific names related to the database (e.g., column with the name of the column).

SHOW CHARACTER SET [LIKE 'pattern'| WHERE expression]

Explanation

This MySQL statement will show all of the character sets installed on the server. To be more selective, use a pattern with the LIKE clause and the wildcard characters (i.e., % and _). Or you may use the WHERE clause to refine the results set.

Examples

As an example of this MySQL statement, to list all of the character sets beginning with the name latin, enter the following:

SHOW CHARACTER SET LIKE 'latin%' \G
*************************** 1. row ***************************
          Charset: latin1
      Description: ISO 8859-1 West European
Default collation: latin1_swedish_ci
           Maxlen: 1
*************************** 2. row ***************************
          Charset: latin2
      Description: ISO 8859-2 Central European
Default collation: latin2_general_ci
           Maxlen: 1
*************************** 3. row ***************************
          Charset: latin5
      Description: ISO 8859-9 Turkish
Default collation: latin5_turkish_ci
           Maxlen: 1
*************************** 4. row ***************************
          Charset: latin7
      Description: ISO 8859-13 Baltic
Default collation: latin7_general_ci
           Maxlen: 1

To see the default character set, use the SHOW VARIABLES statement. To change the client's character set, use the SET CHARACTER SET statement. The Default collation field in the results indicates the related collation for the character set. The Maxlen field gives the maximum number of bytes for storing one character of the character set. For European character sets, this value is usually 1; for asian character sets, it's usually more than 1.