MySql character set learning
1. MySql CHARACTER set includes two concepts: CHARACTER set (CHARACTER) and validation rule (COLLATION. Character set is used to define the way MySql stores strings; validation rules are used to define the way MySql compares strings. Character Set and verification rules are one-to-multiple relationships.
2. Each character set should correspond to at least one verification rule. You can view it using "show collation like '% Character Set %'". For example, you can view the following verification rules for the GBK character set:
3. naming Conventions for verification rules: they start with the relevant Character Set Name, usually including a language name, and end with "underline" + "ci", "cs" or "bin;
(1) _ ci: Case Insensitive (Case Insensitive)
(2) _ cs: case sensitive (case sensitive)
(3) _ bin: binary, that is, the comparison is based on the character encoding value and has nothing to do with the language.
4. Comparison of character set verification rules:
"ERROR 1253 (42000): COLLATION" gbk_chinese_ci 'is not valid for character set 'utf8' "indicates that the current system character set is utf8, the verification rule gbk_chinese_ci 'is not the verification rule of the utf8 character set. You must set the character set to gbk ::
Case-insensitive comparison:
Binary comparison:
<Strong? Http: www.bkjia.com kf ware vc "target =" _ blank "class =" keylink "> VcD4KPHA + pgltzybzcm9 "http://www.2cto.com/uploadfile/Collfiles/20150123/2015012310052713.png" alt = "">