Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COER
来源:互联网 发布:java byte二维数组 编辑:程序博客网 时间:2024/06/07 04:41
部署完项目,测试一下,诶,数据出来了 没有多大问题(暗舒一口气)。继续测吧,一点新建完了,报错了,看看什么错误
一看完了 java.sql.SQLException: Illegal mix of collations (latin1_swedish_ci,IMPLICIT)
and (utf8_general_ci,COERCIBLE) for operation '=' 是这个错误 ,什么原因呢,第一次遇到。
头大了。去查文档说是:结果集中有两种字符集。 我晕了 ,怎么会这样呢,看看表结构,一种啊。 继续查吧。
代码如下复制代码SHOW VARIABLES LIKE 'character_set_%'; 查看一下 显示
+--------------------------+----------------------------+
| Variable_name | Value |
+--------------------------+----------------------------+
| character_set_client | utf8|
| character_set_connection | utf8|
| character_set_database | latin1 |
| character_set_results | utf8|
| character_set_server | latin1 |
| character_set_system | utf8 |
| character_sets_dir | /home/jh/mysql/share/mysql/charsets |
+--------------------------+----------------------------+
再用 SHOW VARIABLES LIKE 'collation_%'; 查看一下 显示
代码如下复制代码+----------------------+-------------------+
| Variable_name | Value |
+----------------------+-------------------+
| collation_connection | utf8_swedish_ci |
| collation_database | latin1_swedish_ci |
| collation_server | latin1_swedish_ci |
+----------------------+-------------------+
原来如此啊 哈哈 知道错在哪里 剩下的就好办了
解决方法:
依次执行:
代码如下复制代码
set character_set_database =utf8;
set character_set_results =utf8;
set character_set_server =utf8;
set character_set_system =utf8; --此处utf-8也可以
然后执行:
SET collation_server = utf8_general_ci
SET collation_database = utf8_general_ci
执行完之后,请检查mysql下每个数据库,表,字段是否都是utf8,不是则改过来,这样子就不会出现
最笨的方法是重装一下数据库。(一般不要用这种方法呀)
- Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COER) 解决办法
- Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COER
- 解决"Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE)
- MySQL Illegal mix of collations (latin1_swedish_ci,COERCIBLE) and (utf8_general_ci,IMPLICIT) for operation 'UNION' 错误解决方法
- [Err] 1267 - Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE)
- Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation
- Mysql: (1267, "Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COERCIBL
- java.sql.SQLException: Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,C
- MySql (1267, "Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE)
- mysql错误:Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE)
- Illegal mix of collations (latin1_swedish_ci,COERCIBLE) and (utf8_general_ci,COERCIBLE)解决
- Illegal mix of collations (utf8_general_ci,IMPLICIT) and (utf8_unicode_ci,IMPLICIT)
- Illegal mix of collations (gb2312_chinese_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE)
- Illegal mix of collations (utf8_general_ci,IMPLICIT) and (utf8_unicode_ci,IMPLIC )
- Illegal mix of collations (utf8_general_ci,IMPLICIT) and (utf8_unicode_ci,IMPLIC )
- Illegal mix of collations (utf8_general_ci,IMPLICIT) and (utf8mb4_general_ci,COERCIBLE)
- Illegal mix of collations (utf8_general_ci,IMPLICIT) and (utf8_unicode_ci,IMPLIC
- Illegal mix of collations (utf8_general_ci,IMPLICIT) and (utf8_unicode_ci,IMPLIC
- 单例模式Singleton
- SpringMVC实现前后台交互jQuery dataTables
- Eclipse如何设置编码格式?(3种方式)
- DeepLearning tutorial(1)Softmax回归原理简介+代码详解
- GridBagLayout的用法
- Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COER
- HDU2846-Repository
- hls直播nginx配置
- 排序
- c++坦克大战
- 工具类:计算距离现在的时间:刚刚/几分钟前/几小时前/几天前/几个月前/几年前
- opencv中Rect类的神奇用法
- leetcode【283 Move Zeros】【python】
- JAVA文件树遍历