mysql Chinese sorting considerations and implementation methods

  • 2020-05-07 20:33:02
  • OfStack

mysql Chinese sorting method 1
mysql is case-insensitive when querying strings, and ISO-8859 character set is generally used as the default character set when compiling mysql. Therefore, the case conversion of Chinese coded characters causes this phenomenon in the comparison process.
For example, change "name char(10)" to "name char(10)binary"."
(successfully tested)

mysql Chinese sorting method 2
Compile mysql using --with--charset=gbk
(not tested)

Related articles: