- MySQL - Home
- MySQL - Introduction
- MySQL - Features
- MySQL - Versions
- MySQL - Variables
- MySQL - Installation
- MySQL - Administration
- MySQL - PHP Syntax
- MySQL - Node.js Syntax
- MySQL - Java Syntax
- MySQL - Python Syntax
- MySQL - Connection
- MySQL - Workbench
- MySQL Databases
- MySQL - Create Database
- MySQL - Drop Database
- MySQL - Select Database
- MySQL - Show Database
- MySQL - Copy Database
- MySQL - Database Export
- MySQL - Database Import
- MySQL - Database Info
- MySQL Users
- MySQL - Create Users
- MySQL - Drop Users
- MySQL - Show Users
- MySQL - Change Password
- MySQL - Grant Privileges
- MySQL - Show Privileges
- MySQL - Revoke Privileges
- MySQL - Lock User Account
- MySQL - Unlock User Account
- MySQL Tables
- MySQL - Create Tables
- MySQL - Show Tables
- MySQL - Alter Tables
- MySQL - Rename Tables
- MySQL - Clone Tables
- MySQL - Truncate Tables
- MySQL - Temporary Tables
- MySQL - Repair Tables
- MySQL - Describe Tables
- MySQL - Add/Delete Columns
- MySQL - Show Columns
- MySQL - Rename Columns
- MySQL - Table Locking
- MySQL - Drop Tables
- MySQL - Derived Tables
- MySQL Queries
- MySQL - Queries
- MySQL - Constraints
- MySQL - Insert Query
- MySQL - Select Query
- MySQL - Update Query
- MySQL - Delete Query
- MySQL - Replace Query
- MySQL - Insert Ignore
- MySQL - Insert on Duplicate Key Update
- MySQL - Insert Into Select
- MySQL Indexes
- MySQL - Indexes
- MySQL - Create Index
- MySQL - Drop Index
- MySQL - Show Indexes
- MySQL - Unique Index
- MySQL - Clustered Index
- MySQL - Non-Clustered Index
- MySQL Operators and Clauses
- MySQL - Where Clause
- MySQL - Limit Clause
- MySQL - Distinct Clause
- MySQL - Order By Clause
- MySQL - Group By Clause
- MySQL - Having Clause
- MySQL - AND Operator
- MySQL - OR Operator
- MySQL - Like Operator
- MySQL - IN Operator
- MySQL - ANY Operator
- MySQL - EXISTS Operator
- MySQL - NOT Operator
- MySQL - NOT EQUAL Operator
- MySQL - IS NULL Operator
- MySQL - IS NOT NULL Operator
- MySQL - Between Operator
- MySQL - UNION Operator
- MySQL - UNION vs UNION ALL
- MySQL - MINUS Operator
- MySQL - INTERSECT Operator
- MySQL - INTERVAL Operator
- MySQL Joins
- MySQL - Using Joins
- MySQL - Inner Join
- MySQL - Left Join
- MySQL - Right Join
- MySQL - Cross Join
- MySQL - Full Join
- MySQL - Self Join
- MySQL - Delete Join
- MySQL - Update Join
- MySQL - Union vs Join
- MySQL Keys
- MySQL - Unique Key
- MySQL - Primary Key
- MySQL - Foreign Key
- MySQL - Composite Key
- MySQL - Alternate Key
- MySQL Triggers
- MySQL - Triggers
- MySQL - Create Trigger
- MySQL - Show Trigger
- MySQL - Drop Trigger
- MySQL - Before Insert Trigger
- MySQL - After Insert Trigger
- MySQL - Before Update Trigger
- MySQL - After Update Trigger
- MySQL - Before Delete Trigger
- MySQL - After Delete Trigger
- MySQL Data Types
- MySQL - Data Types
- MySQL - VARCHAR
- MySQL - BOOLEAN
- MySQL - ENUM
- MySQL - DECIMAL
- MySQL - INT
- MySQL - FLOAT
- MySQL - BIT
- MySQL - TINYINT
- MySQL - BLOB
- MySQL - SET
- MySQL Regular Expressions
- MySQL - Regular Expressions
- MySQL - RLIKE Operator
- MySQL - NOT LIKE Operator
- MySQL - NOT REGEXP Operator
- MySQL - regexp_instr() Function
- MySQL - regexp_like() Function
- MySQL - regexp_replace() Function
- MySQL - regexp_substr() Function
- MySQL Fulltext Search
- MySQL - Fulltext Search
- MySQL - Natural Language Fulltext Search
- MySQL - Boolean Fulltext Search
- MySQL - Query Expansion Fulltext Search
- MySQL - ngram Fulltext Parser
- MySQL Functions & Operators
- MySQL - Date and Time Functions
- MySQL - Arithmetic Operators
- MySQL - Numeric Functions
- MySQL - String Functions
- MySQL - Aggregate Functions
- MySQL Misc Concepts
- MySQL - NULL Values
- MySQL - Transactions
- MySQL - Using Sequences
- MySQL - Handling Duplicates
- MySQL - SQL Injection
- MySQL - SubQuery
- MySQL - Comments
- MySQL - Check Constraints
- MySQL - Storage Engines
- MySQL - Export Table into CSV File
- MySQL - Import CSV File into Database
- MySQL - UUID
- MySQL - Common Table Expressions
- MySQL - On Delete Cascade
- MySQL - Upsert
- MySQL - Horizontal Partitioning
- MySQL - Vertical Partitioning
- MySQL - Cursor
- MySQL - Stored Functions
- MySQL - Signal
- MySQL - Resignal
- MySQL - Character Set
- MySQL - Collation
- MySQL - Wildcards
- MySQL - Alias
- MySQL - ROLLUP
- MySQL - Today Date
- MySQL - Literals
- MySQL - Stored Procedure
- MySQL - Explain
- MySQL - JSON
- MySQL - Standard Deviation
- MySQL - Find Duplicate Records
- MySQL - Delete Duplicate Records
- MySQL - Select Random Records
- MySQL - Show Processlist
- MySQL - Change Column Type
- MySQL - Reset Auto-Increment
- MySQL - Coalesce() Function
MySQL - SHOW CHARACTER SET Statement
MySQL SHOW CHARACTER SET Statement
Character set of MySQL is the set of legal characters that are allowed in a string. MySQL provides several character-sets you can see the list of all the available character sets using the SHOW CHARACTER SET statement.
Syntax
Following is the syntax of the ALTER DATABASE statement −
SHOW CHARACTER SET [LIKE 'pattern' | WHERE expr]
Example
Following query retrieves all the available character sets −
SHOW CHARACTER SET\G;
Output
The above query produces the output shown below −
*********** 1. row ***********
Charset: armscii8
Description: ARMSCII-8 Armenian
Default collation: armscii8_general_ci
Maxlen: 1
*********** 2. row ***********
Charset: ascii
Description: US ASCII
Default collation: ascii_general_ci
Maxlen: 1
*********** 3. row ***********
Charset: big5
Description: Big5 Traditional Chinese
Default collation: big5_chinese_ci
Maxlen: 2
*********** 4. row ***********
Charset: binary
Description: Binary pseudo charset
Default collation: binary
Maxlen: 1
*********** 5. row ***********
Charset: cp1250
Description: Windows Central European
Default collation: cp1250_general_ci
Maxlen: 1
*********** 6. row ***********
Charset: cp1251
Description: Windows Cyrillic
Default collation: cp1251_general_ci
Maxlen: 1
*********** 7. row ***********
Charset: cp1256
Description: Windows Arabic
Default collation: cp1256_general_ci
Maxlen: 1
*********** 8. row ***********
Charset: cp1257
Description: Windows Baltic
Default collation: cp1257_general_ci
Maxlen: 1
*********** 9. row ***********
Charset: cp850
Description: DOS West European
Default collation: cp850_general_ci
Maxlen: 1
*********** 10. row ***********
Charset: cp852
Description: DOS Central European
Default collation: cp852_general_ci
Maxlen: 1
*********** 11. row ***********
Charset: cp866
Description: DOS Russian
Default collation: cp866_general_ci
Maxlen: 1
*********** 12. row ***********
Charset: cp932
Description: SJIS for Windows Japanese
Default collation: cp932_japanese_ci
Maxlen: 2
*********** 13. row ***********
Charset: dec8
Description: DEC West European
Default collation: dec8_swedish_ci
Maxlen: 1
*********** 14. row ***********
Charset: eucjpms
Description: UJIS for Windows Japanese
Default collation: eucjpms_japanese_ci
Maxlen: 3
*********** 15. row ***********
Charset: euckr
Description: EUC-KR Korean
Default collation: euckr_korean_ci
Maxlen: 2
*********** 16. row ***********
Charset: gb18030
Description: China National Standard GB18030
Default collation: gb18030_chinese_ci
Maxlen: 4
*********** 17. row ***********
Charset: gb2312
Description: GB2312 Simplified Chinese
Default collation: gb2312_chinese_ci
Maxlen: 2
*********** 18. row ***********
Charset: gbk
Description: GBK Simplified Chinese
Default collation: gbk_chinese_ci
Maxlen: 2
*********** 19. row ***********
Charset: geostd8
Description: GEOSTD8 Georgian
Default collation: geostd8_general_ci
Maxlen: 1
*********** 20. row ***********
Charset: greek
Description: ISO 8859-7 Greek
Default collation: greek_general_ci
Maxlen: 1
*********** 21. row ***********
Charset: hebrew
Description: ISO 8859-8 Hebrew
Default collation: hebrew_general_ci
Maxlen: 1
*********** 22. row ***********
Charset: hp8
Description: HP West European
Default collation: hp8_english_ci
Maxlen: 1
*********** 23. row ***********
Charset: keybcs2
Description: DOS Kamenicky Czech-Slovak
Default collation: keybcs2_general_ci
Maxlen: 1
*********** 24. row ***********
Charset: koi8r
Description: KOI8-R Relcom Russian
Default collation: koi8r_general_ci
Maxlen: 1
*********** 25. row ***********
Charset: koi8u
Description: KOI8-U Ukrainian
Default collation: koi8u_general_ci
Maxlen: 1
*********** 26. row ***********
Charset: latin1
Description: cp1252 West European
Default collation: latin1_swedish_ci
Maxlen: 1
*********** 27. row ***********
Charset: latin2
Description: ISO 8859-2 Central European
Default collation: latin2_general_ci
Maxlen: 1
*********** 28. row ***********
Charset: latin5
Description: ISO 8859-9 Turkish
Default collation: latin5_turkish_ci
Maxlen: 1
*********** 29. row ***********
Charset: latin7
Description: ISO 8859-13 Baltic
Default collation: latin7_general_ci
Maxlen: 1
*********** 30. row ***********
Charset: macce
Description: Mac Central European
Default collation: macce_general_ci
Maxlen: 1
*********** 31. row ***********
Charset: macroman
Description: Mac West European
Default collation: macroman_general_ci
Maxlen: 1
*********** 32. row ***********
Charset: sjis
Description: Shift-JIS Japanese
Default collation: sjis_japanese_ci
Maxlen: 2
*********** 33. row ***********
Charset: swe7
Description: 7bit Swedish
Default collation: swe7_swedish_ci
Maxlen: 1
*********** 34. row ***********
Charset: tis620
Description: TIS620 Thai
Default collation: tis620_thai_ci
Maxlen: 1
*********** 35. row ***********
Charset: ucs2
Description: UCS-2 Unicode
Default collation: ucs2_general_ci
Maxlen: 2
*********** 36. row ***********
Charset: ujis
Description: EUC-JP Japanese
Default collation: ujis_japanese_ci
Maxlen: 3
*********** 37. row ***********
Charset: utf16
Description: UTF-16 Unicode
Default collation: utf16_general_ci
Maxlen: 4
*********** 38. row ***********
Charset: utf16le
Description: UTF-16LE Unicode
Default collation: utf16le_general_ci
Maxlen: 4
*********** 39. row ***********
Charset: utf32
Description: UTF-32 Unicode
Default collation: utf32_general_ci
Maxlen: 4
*********** 40. row ***********
Charset: utf8mb3
Description: UTF-8 Unicode
Default collation: utf8mb3_general_ci
Maxlen: 3
*********** 41. row ***********
Charset: utf8mb4
Description: UTF-8 Unicode
Default collation: utf8mb4_0900_ai_ci
Maxlen: 4
The LIKE clause
Using the LIKE clause, you can specify a pattern to retrieve the description of the specified character set −
SHOW CHARACTER SET LIKE '%utf%';
Output
Following is the output of the above query −
| Charset | Description | Default collation | Maxlen |
|---|---|---|---|
| utf16 | UTF-16 Unicode | utf16_general_ci | 4 |
| utf16le | UTF-16LE Unicode | utf16le_general_ci | 4 |
| utf32 | UTF-32 Unicode | utf32_general_ci | 4 |
| utf8 | UTF-8 Unicode | utf8_general_ci | 3 |
| utf8mb4 | UTF-8 Unicode | utf8mb4_0900_ai_ci | 4 |
The WHERE clause
You can use the WHERE clause of the SHOW CHARACTER SET statements to retrieve description of the variables which match the specified condition.
SHOW CHARACTER SET WHERE Maxlen =4;
Output
After executing the above query, it will produce the following output &minusl;
| Charset | Description | Default collation | Maxlen |
|---|---|---|---|
| gb18030 | China National Standard GB18030 | gb18030_chinese_ci | 4 |
| utf16 | UTF-16 Unicode | utf16_general_ci | 4 |
| utf16le | TF-16LE Unicode | utf16le_general_ci | 4 |
| utf32 | UTF-32 Unicode | utf32_general_ci | 4 |
| utf8mb4 | UTF-8 Unicode | utf8mb4_0900_ai_ci | 4 |