i’m trying to save text in utf-8 languages (hebrew-arabic-etc..) and it fails .. first it was giving me (????????)
so i put this in dataSource.groovy
dbCreate = “update”
url = “jdbc:mysql://localhost/db_name?useUnicode=yes&characterEncoding=UTF-8”
}
and i’ve convert the whole database and it’s table to have collation utf-8 and charset also..
it gives me error says
ERROR util.JDBCExceptionReporter – Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation ‘=’
2012-07-01 21:54:25,969 [http-8080-1] ERROR errors.GrailsExceptionResolver – Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation ‘=’
java.sql.SQLException: Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation ‘=’
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1075)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3566)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3498)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1959)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2113)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2568)
at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2113)
at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:2275)
at com.ehs.GameNewsController$_closure4.doCall(GameNewsController.groovy:27)
at com.ehs.GameNewsController$_closure4.doCall(GameNewsController.groovy)
at java.lang.Thread.run(Thread.java:680)
so what is the wrong am I doing..
The error states clearly that there’s a mixing of “latin1_swedish_ci” and “utf8_general_ci” collation. Please try checking again that you don’t have any field in any table that is still in latin1_swedish_ci COLLATE.