简体   繁体   中英

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. Is there a way to change the default MySQL collation? If not what is the best way around this? Thanks

Are the collation options specified in your MySQL configuration file (normally named my.cnf). It should look something like this (in the [mysqld] section):

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

More info:

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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