Skip to content

Instantly share code, notes, and snippets.

@hykw
Last active August 29, 2015 14:04
Show Gist options
  • Save hykw/bb0a1d034b648c275643 to your computer and use it in GitHub Desktop.
Save hykw/bb0a1d034b648c275643 to your computer and use it in GitHub Desktop.
MySQL: Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation '='
/etc/my.cnf
-------------------------
default-character-set=utf8
character-set-server = utf8
collation-server=utf8_general_ci
init_connect='SET collation_database = utf8_general_ci; SET collation_connection = utf8_general_ci'
skip-character-set-client-handshake
-------------------------
mysql> ALTER DATABASE db CHARACTER SET utf8 COLLATE utf8_general_ci
mysql> ALTER TABLE table CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment