我正在尝试以 utf-8 语言(希伯来语-阿拉伯语等..)保存文本,但它失败了..首先它给了我(???????) 所以我把它放在 dataSource.groovy 中 dbCreate = "更新" url = "jdbc:mysql://localhost/db_name?useUnicode=yes&characterEncoding=UTF-8" } 我已经转换了整个数据库,它的表也有归类 utf-8 和字符集..
它给我错误说
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)
所以我做错了什么..
最佳答案
错误清楚地表明存在“latin1_swedish_ci”和“utf8_general_ci”归类的混合。请再次尝试检查您在任何仍在 latin1_swedish_ci COLLATE 中的表中没有任何字段。
关于mysql - grails:尝试在 mysql 中保存 utf-8 失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11285778/