Home >Database >Mysql Tutorial >让MySQL支持中文排序_MySQL

让MySQL支持中文排序_MySQL

WBOY
WBOYOriginal
2016-06-01 13:50:561184browse

bitsCN.com 让MySQL支持中文排序
编绎MySQL时一般以ISO-8859字符集作为默认的字符集,因此在比较过程中中文编码字符大小写转换造成了这种现象,一种解决方法是对于包含中文的字段加上"binary"属性,使之作为二进制比较,例如将"name char(10)"改成"name char(10)binary"。 编译MySQL时使用--with--charset=gbk 参数,这样MySQL就会直接支持中文查找和排序了。bitsCN.com

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn