Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation '=' 解决方法
1. 代码
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 |
2. 代码
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,如果不是话,改成utf8格式;3. 修改mysql安装目录下的my.ini文件
[mysql]
default-character-set=utf8
配置好后,重启mysql。
另外存储过程也需要注意一下。
Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation '=' 解决方法的更多相关文章
- Django的admin管理系统写入中文出错的解决方法/1267 Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation ‘locate’
Django的admin管理系统写入中文出错的解决方法 解决错误: 1267 Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and ( ...
- java.sql.SQLException: Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation '=' 异常处理,及MySQL数据库编码设置
java.sql.SQLException: Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,C ...
- b-is-in- (1267, "Illegal mix of collations (utf8mb4_unicode_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation '='") SELECT id FROM qqzoneshuoshuo WHERE words=
db-is-in- (1267, "Illegal mix of collations (utf8mb4_unicode_ci,IMPLICIT) and (utf8_general_ci, ...
- Illegal mix of collations (big5_chinese_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation 'like'
解释: 非法的混合排序规则(big5_chinese_ci)和(utf8_general_ci)操作“like”. 原本是单个字段查询数据的,现在是把所有的字段用一个搜索框来查询. 主要出问题是下列这 ...
- 1267 - Illegal mix of collations (gbk_chinese_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation '=' | 1267 - Illegal mix of collations (gbk_chinese_ci,IMPLICIT) and (Latin,COERCIBL)
select * FROM information_schema.columns WHERE table_schema = "databaseName" and collation ...
- Mysql查询报错:Illegal mix of collations (gbk_chinese_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation '='
使用sql别名关联查询的时候,由于字符集冲突导致该错误 解决方案,查询的时候强制转换字符集类型 case when column = '' then _gbk '' collate gbk_chine ...
- 解决Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COER
今天在用java与mysql数据库时发现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...
最近刚接触mysql,今天用mysql插入中文字符的时候,程序报错“Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_g ...
- Mysql Illegal mix of collations (utf8_unicode_ci,IMPLICIT) and (utf8_general_ci,IMPLICIT) for operation '='
MySQL字符串比较bug: select * from table_a a left join table_b b on a.field_a = b.field_b error: Illegal ...
随机推荐
- static_cast ,reinterpret_cast
用法:static_cast < type-id > ( expression ) 该运算符把expression转换为type-id类型,但没有运行时类型检查来保证转换的安全性.它主要有 ...
- css实现半颗星评分效果
效果如下: html代码 <!DOCTYPE html> <html lang="en"> <head> <meta charset=&q ...
- BZOJ3157: 国王奇遇记 & 3516: 国王奇遇记加强版
令\[S_i=\sum_{k=1}^n k^i m^k\]我们有\[\begin{eqnarray*}(m-1)S_i & = & mS_i - S_i \\& = & ...
- WAF防御能力评测及工具
本篇文章介绍如何从常规攻击的防御能力来评测一款WAF.一共覆盖了十六种攻击类型,每种类型均从利用场景(攻击操作的目的),注入点(漏洞产生的地方,比如说大多数WAF都会较全面地覆盖来自GET请求的攻击, ...
- unity mipmap 糊
unity 开miapmap会糊很多 尤其在editor里面 我估计和editor的 tempRT resolution 957x380有关 -----确实是这样 手机上糊的程度低很多 中间rt我用的 ...
- ISP图像调试工程师——对比度增强(熟悉图像预处理和后处理技术)
经典对比度增强算法: http://blog.csdn.net/ebowtang/article/details/38236441
- oracle 解锁表的一个小问题
最近开发的时候遇到一个小问题,执行一段sql之后发现 表被锁了 显示错误为:ora-00054:resource busy and acquire with nowait specified 百度之后 ...
- windows系统中常用的快捷键
开发中,一些常用的键盘技巧: (1)快速切换桌面(alt+tab)或者是(window+tab) (2)迅速关闭当前页面 (3)迅速收起所有页面 (4)直接回到桌面页面 (5)锁定你的屏幕
- ANDROID颜色设置
Android中的颜色设置 1.在android中经常看到设置的颜色为八位的十六进制的颜色值,例如: public static final class color { public static ...
- 基于Qt的A*算法可视化分析
代码地址如下:http://www.demodashi.com/demo/13677.html 需求 之前做过一个无人车需要自主寻找最佳路径,所以研究了相关的寻路算法,最终选择A算法,因为其简单易懂, ...