-
-
Save TimLang/ffc7c03cf277fd83526194b831289fd1 to your computer and use it in GitHub Desktop.
Mysql2::Error: Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| locate my.cnf | |
| change character set and collation | |
| [mysqld] | |
| character_set_server = utf8 | |
| collation_server = utf8_general_ci | |
| in console if your database is not huge. | |
| ActiveRecord::Base.connection.tables.each do |table| | |
| ActiveRecord::Base.connection.execute "ALTER TABLE #{table} CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;" | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment