什么是MySQL Collation,如何在实践中使用它? [英] What is MySQL Collation, how to use it in practice?
本文介绍了什么是MySQL Collation,如何在实践中使用它?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
假设我想用4种语言的一些怪异语言制作一个搜索引擎:
Let's say I want to make a search engine in some weird languages in 4 languages:
英语 瑞典 希伯来语 阿拉伯语
English Swedish Hebrew Arabic
如何在MySQL中设置排序规则?
How would I set the collations in MySQL ?
推荐答案
排序规则确定MySQL如何比较字符串.
The collation determines how MySQL compares strings.
可以找到所有字符集和排序规则的列表:
A list of all character sets and collations can be found with:
SHOW CHARACTER SET;
SHOW COLLATION;
要更改表的排序规则,请使用:
To change the collation for a table use:
ALTER TABLE `my_table` DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci
http://dev.mysql.com/doc/refman/5.0/en/charset.html
这篇关于什么是MySQL Collation,如何在实践中使用它?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文