简体   繁体   English

如何更改rake db的MySql的默认排序规则:create:all in rails?

[英]How do you change the default collation of MySql for rake db:create:all in rails?

In my rails app I am running rake db:create:all in order to create the databases and I am prompted that the collations do not match. 在我的rails应用程序中,我正在运行rake db:create:all以创建数据库,并且提示我的排序规则不匹配。 Is there a way to change the default MySQL collation? 有没有办法更改默认的MySQL排序规则? If not what is the best way around this? 如果不是最好的方法是什么? Thanks 谢谢

Are the collation options specified in your MySQL configuration file (normally named my.cnf). 是否在MySQL配置文件中指定了排序规则选项(通常名为my.cnf)。 It should look something like this (in the [mysqld] section): 它应该看起来像这样(在[mysqld]部分):

character-set-server=utf8
collation-server=utf8_general_ci

More info: 更多信息:

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM