The Answer to Life, the Universe, and Everything

Wednesday, December 10, 2008

Illegal mix of collations in MySQL

In case for having such a error in mysql using Hibernate or so.

java.sql.SQLException: General error message
from server: "Illegal mix of collations
(utf8_general_ci,COERCIBLE) and
(latin1_swedish_ci,IMPLICIT) for operation '='"


Add the following in my.cnf
[client]
default-character-set = utf8

[mysqld]
skip-character-set-client-handshake
default-character-set=utf8
character-set-server=utf8
init-connect=SET NAMES utf8

No comments: