Mysql Globalization Abstract
Total Page:16
File Type:pdf, Size:1020Kb
MySQL Globalization Abstract This is the MySQL Globalization extract from the MySQL 5.6 Reference Manual. For legal information, see the Legal Notices. For help with using MySQL, please visit the MySQL Forums, where you can discuss your issues with other MySQL users. Document generated on: 2021-09-23 (revision: 70881) Table of Contents Preface and Legal Notices .................................................................................................................. v 1 Character Sets, Collations, Unicode ................................................................................................. 1 1.1 Character Sets and Collations in General .............................................................................. 2 1.2 Character Sets and Collations in MySQL ............................................................................... 3 1.2.1 Character Set Repertoire ........................................................................................... 5 1.2.2 UTF-8 for Metadata ................................................................................................... 6 1.3 Specifying Character Sets and Collations .............................................................................. 8 1.3.1 Collation Naming Conventions .................................................................................... 8 1.3.2 Server Character Set and Collation ............................................................................ 9 1.3.3 Database Character Set and Collation ...................................................................... 10 1.3.4 Table Character Set and Collation ............................................................................ 11 1.3.5 Column Character Set and Collation ......................................................................... 11 1.3.6 Character String Literal Character Set and Collation .................................................. 13 1.3.7 The National Character Set ...................................................................................... 14 1.3.8 Character Set Introducers ........................................................................................ 15 1.3.9 Examples of Character Set and Collation Assignment ................................................ 16 1.3.10 Compatibility with Other DBMSs ............................................................................. 17 1.4 Connection Character Sets and Collations ........................................................................... 17 1.5 Configuring Application Character Set and Collation ............................................................. 24 1.6 Error Message Character Set .............................................................................................. 25 1.7 Column Character Set Conversion ...................................................................................... 26 1.8 Collation Issues .................................................................................................................. 28 1.8.1 Using COLLATE in SQL Statements ......................................................................... 28 1.8.2 COLLATE Clause Precedence ................................................................................. 28 1.8.3 Character Set and Collation Compatibility ................................................................. 29 1.8.4 Collation Coercibility in Expressions .......................................................................... 29 1.8.5 The binary Collation Compared to _bin Collations ...................................................... 30 1.8.6 Examples of the Effect of Collation ........................................................................... 32 1.8.7 Using Collation in INFORMATION_SCHEMA Searches ............................................. 34 1.9 Unicode Support ................................................................................................................. 36 1.9.1 The utf8mb4 Character Set (4-Byte UTF-8 Unicode Encoding) ................................... 37 1.9.2 The utf8mb3 Character Set (3-Byte UTF-8 Unicode Encoding) ................................... 38 1.9.3 The utf8 Character Set (Alias for utf8mb3) ................................................................ 38 1.9.4 The ucs2 Character Set (UCS-2 Unicode Encoding) .................................................. 39 1.9.5 The utf16 Character Set (UTF-16 Unicode Encoding) ................................................ 39 1.9.6 The utf16le Character Set (UTF-16LE Unicode Encoding) .......................................... 39 1.9.7 The utf32 Character Set (UTF-32 Unicode Encoding) ................................................ 39 1.9.8 Converting Between 3-Byte and 4-Byte Unicode Character Sets ................................. 40 1.10 Supported Character Sets and Collations ........................................................................... 42 1.10.1 Unicode Character Sets ......................................................................................... 43 1.10.2 West European Character Sets .............................................................................. 49 1.10.3 Central European Character Sets ........................................................................... 50 1.10.4 South European and Middle East Character Sets .................................................... 51 1.10.5 Baltic Character Sets ............................................................................................. 52 1.10.6 Cyrillic Character Sets ............................................................................................ 52 1.10.7 Asian Character Sets ............................................................................................. 53 1.10.8 The Binary Character Set ....................................................................................... 56 1.11 Restrictions on Character Sets .......................................................................................... 57 1.12 Setting the Error Message Language ................................................................................. 58 1.13 Adding a Character Set .................................................................................................... 58 1.13.1 Character Definition Arrays ..................................................................................... 60 iii MySQL Globalization 1.13.2 String Collating Support for Complex Character Sets ............................................... 61 1.13.3 Multi-Byte Character Support for Complex Character Sets ........................................ 61 1.14 Adding a Collation to a Character Set ................................................................................ 62 1.14.1 Collation Implementation Types .............................................................................. 63 1.14.2 Choosing a Collation ID ......................................................................................... 65 1.14.3 Adding a Simple Collation to an 8-Bit Character Set ................................................ 66 1.14.4 Adding a UCA Collation to a Unicode Character Set ................................................ 67 1.15 Character Set Configuration .............................................................................................. 74 1.16 MySQL Server Locale Support .......................................................................................... 75 2 MySQL Server Time Zone Support ................................................................................................ 81 iv Preface and Legal Notices This is the MySQL Globalization extract from the MySQL 5.6 Reference Manual. Licensing information—MySQL 5.6. This product may include third-party software, used under license. If you are using a Commercial release of MySQL 5.6, see the MySQL 5.6 Commercial Release License Information User Manual for licensing information, including licensing information relating to third- party software that may be included in this Commercial release. If you are using a Community release of MySQL 5.6, see the MySQL 5.6 Community Release License Information User Manual for licensing information, including licensing information relating to third-party software that may be included in this Community release. Licensing information—MySQL NDB Cluster 7.3. This product may include third-party software, used under license. If you are using a Commercial release of NDB Cluster 7.3, see the MySQL NDB Cluster 7.3 Commercial Release License Information User Manual for licensing information relating to third-party software that may be included in this Commercial release. If you are using a Community release of NDB Cluster 7.3, see the MySQL NDB Cluster 7.3 Community Release License Information User Manual for licensing information relating to third-party software that may be included in this Community release. Licensing information—MySQL NDB Cluster 7.4. This product may include third-party software, used under license. If you are using a Commercial release of NDB Cluster 7.4, see the MySQL NDB Cluster 7.4 Commercial Release License Information User Manual for licensing information relating to third-party software that may be included in this Commercial release. If you are using a Community release of NDB Cluster 7.4, see the MySQL NDB Cluster 7.4 Community Release License Information User Manual for licensing information relating to third-party software that may be included