ERROR 1267 (HY000): Illegal mix of collations (utf8_general_ci,IMPLICIT) and (gbk_chinese_ci,COERCIB
来源:互联网 发布:mac文档怎么保存 编辑:程序博客网 时间:2024/06/05 10:54
在查询时,反馈了如下错误:
ERROR 1267 (HY000): Illegal mix of collations (utf8_general_ci,IMPLICIT) and (gbk_chinese_ci,COERCIBLE) for operation 'like'
mysql> show variables like '%coll%';
+----------------------+-----------------+
| Variable_name | Value |
+----------------------+-----------------+
| collation_connection | gbk_chinese_ci |
| collation_database | utf8_general_ci |
| collation_server | utf8_general_ci |
+----------------------+-----------------+
3 rows in set (0.00 sec)
三者信息不一致。
查看我参数文件配置,发现[client]和[mysql]字符集都是gbk
[client]
default-character-set=gbk
[mysql]
default-character-set=gbk
可以修改本会话变量collation_connection为utf8_general_ci解决。但是下次再连接时就又失效了。而且该参数不能通过修改全局变量使所有会话生效,只能通过修改参数文件。
修改配置文件,将[client]和[mysql]下的default-character-set都改为utf8,重启数据库,
mysql> show variables like '%coll%';
+----------------------+-----------------+
| Variable_name | Value |
+----------------------+-----------------+
| collation_connection | utf8_general_ci |
| collation_database | utf8_general_ci |
| collation_server | utf8_general_ci |
+----------------------+-----------------+
3 rows in set (0.00 sec)
再查询,没有再报这个错误了。
- ERROR 1267 (HY000): Illegal mix of collations (utf8_general_ci,IMPLICIT) and (gbk_chinese_ci,COERCIB
- 数据库错误发生 1267 Illegal mix of collations (gbk_chinese_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) fo
- java.sql.SQLException: Illegal mix of collations (gbk_chinese_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation '='
- 解决Mysql:Illegal mix of collations (gbk_chinese_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation '='
- mysql错误提示Illegal mix of collations (gbk_chinese_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE)的一个解决办法
- mysql错误提示Illegal mix of collations (gbk_chinese_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE)的一个解决办法
- mysql错误提示Illegal mix of collations (gbk_chinese_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE)
- Illegal mix of collations (utf8_general_ci,IMPLICIT) and (utf8_unicode_ci,IMPLICIT)
- Error Code: 1267. Illegal mix of collations (utf8_unicode_ci,IMPLICIT) and (utf8_general_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 (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COER) 解决办法
- Illegal mix of collations (utf8_general_ci,IMPLICIT) and (utf8_unicode_ci,IMPLIC )
- 解决"Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE)
- 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 (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COER
- Illegal mix of collations (utf8_general_ci,IMPLICIT) and (utf8_unicode_ci,IMPLIC
- 深入分析ConcurrentHashMap
- JUnit教程 -- 使用Eclipse的JUnit实例
- 网关设计需要考虑的问题
- 排序——归并排序
- JNI学习积累之二 ---- 数据类型映射、域描述符说明
- ERROR 1267 (HY000): Illegal mix of collations (utf8_general_ci,IMPLICIT) and (gbk_chinese_ci,COERCIB
- 通过pwnable.kr从零学pwn
- Windows 下 MySQL 简单定时自动备份、删除过期备份
- Vim命令合集
- Trapping Rain Water
- MFC中网络编程,利用套接字的过程。
- 两个Java项目之间的通信
- Python小记05
- Memcache安全配置