mysql - grails:尝试在 mysql 中保存 utf-8 失败

标签 mysql grails datasource

我正在尝试以 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/

相关文章:

java - Grails Spring 安全注册需适度

spring - Postgres JDBC 数据源实例

iPhone UIPickerview reloadAllComponents 不起作用

c# - 当数据源中只有 1 项时,FormView 不显示 PagerTemplate

php - WordPress 插件数据库创建 - 如何在插件激活时将多个 "UNIQUE KEY' s"添加到表中

mysql - 创建存储过程 : setting the character set and collation

MySQL 外键验证问题

grails - 如何间接引用 grails GSP 模型变量,例如通过 .get(...)

javascript - WAR 文件已部署,但在 GlassFish 上运行不正常

mysql - 使用node js在mysql中生成唯一id的有效方法是什么?