The 1.MYSQL character set includes two concepts: the character set (CHARACTER) and the checksum rule (COLLATION). A character set is used to define how MySQL stores strings, and a validation rule is used to define how MySQL compares strings. A character set is a one-to-many relationship with a validation rule.
2. Each character set should correspond to at least one validation rule, which can be viewed using the "show COLLATION like '% character set% '", for example to view the GBK character set as follows:
3. Validation Rule naming convention: They start with their associated character set name, usually including a language name, and end with "underscore" + "CI" or "cs" or "bin";
(1) _ci: Case insensitive (case insensitive)
(2) _cs: Case Sensitive (strictly case-insensitive)
(3) _bin: Two Yuan, that is, the comparison is based on the value of character encoding and language-independent.
4. The character set check rules are compared as follows:
"Error 1253 (42000): COLLATION ' gbk_chinese_ci ' is not valid for CHARACTER set ' UTF8 '" error message meaning is: Current system character set is UTF8, checksum rule gbk_chines E_ci ' is not a validation rule for the UTF8 character set, it needs to be GBK::
Case-insensitive comparisons:
Binary comparison:
MySQL Character Set learning