Forum: Ruby on Rails Best way to set database connection collation in rails?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
2012ef615d01121a0f035df9bf5707b2?d=identicon&s=25 Alex (Guest)
on 2013-06-12 22:35
(Received via mailing list)
Hello, I want to change the connection collation that rails uses but I'm
unsure of exactly what the best way to do this is.  Everything in MySQL
-
the server, database and all tables are set to utf8_unicode_ci
collation,
but the connection collation in rails still appears to be
utf8_general_ci
(the default?).  We are using the mysql2 adapter.

I've seen a couple of possible methods:
Set the collation to utf8_unicode_ci via an init-connect line in the
database server's my.cnf
Set the ActiveRecord ConnectionAdapter to use the desired collation.

Is there a best approach?

Alternately, how much does it matter if the connection collation doesn't
match set in the database server?

Thanks,

~ Alex
This topic is locked and can not be replied to.