MySQL Crash Course #19# Chapter 27. Globalization and Localization

Globalization and Localization

When discussing multiple languages and characters sets, you will run into the following important terms:

  • Character sets are collections of letters and symbols.

  • Encodings are the internal representations of the members of a character set.

  • Collations are the instructions that dictate how characters are to be compared.

A few notes about character sets and collations:

  • In normal operations, such as SELECT and INSERT, we don't need to worry about the character set, because the character set and sort order are set at the server, database, and table levels. These things are usually configured when you install the database.
  • If you do not specify a character set when creating a table, the database will automatically configure the default character set for you.
  • You can even set the character set specifically for the specified column.
  • You can specify a specific collation (COLLATE) in many scenarios such as sorting, GROUP BY, using aggregate functions, etc.

 A few operations as the name suggests:

--Display the current character set and collation 
SHOW VARIABLES LIKE  ' character% ' ;
SHOW VARIABLES LIKE  ' collation% ' ;
 -- show all available character sets and collations 
SHOW CHARACTER  SET ;
SHOW COLLATION;

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324773331&siteId=291194637