If this problem is not solved, MySQL cannot actually process Chinese characters. The reason for this problem is that MySQL is case insensitive when querying strings, in programming MySQL, The ISO-8859 character set is generally used as the default character set, therefore, the case-sensitivity conversion of Chinese encoding Characters During the comparison process causes this phenomenon.
Solution:
Add the "binary" attribute to a field that contains Chinese characters for Binary comparison. For example, change "name char (10)" to "name char (10) binary ".
If you use the source code to compile MySQL, you can use the -- with -- charset = GBK parameter when compiling MySQL, so that MySQL can directly support Chinese search and sorting (Latin1 by default ). You can also use extra-charsets = gb2312 and GBK to add multiple character sets.
If you do not want to modify the table structure or re-compile MySQL, you can also use the convert function in the order by section of the query statement. For example, select * From mytable order by convert (chinesecolumnname using GBK );