c#程序连接mysql,报"Illegal mix of collations (utf8_general_ci,IMPLICIT) and (utf8_unicode_ci,IMPLICIT) fo...
===============================================
20170607_第一次修改 ccb_warlock
===============================================
工作关系开发一个连接mysql的c#程序,交付测试后反应在连测试环境的数据库后出现报错且数据无法获取的情况。(如下图所示)
查到了http://www.cnblogs.com/xiaochaohuashengmi/archive/2010/07/23/1783589.html后我意识到可能是表的字段的编码(navicat中时字段的"排序规则")与关联表字段的编码不一致,故导致该报错。
根据这个思路,设断点找到查询sql,检查测试环境中这几张表的字段编码,果然发现其中一个表的字段编码与别的表不一致,使用的都是utf8_unicode_ci(别的表设计的编码是utf8_general_ci)。
测试环境该表的编码图
我调试时借用的是开发环境,那么开发和测试环境这个表的编码有差异吗?随后查看了开发环境的配置,果然存在差异。
开发环境该表的编码图
猜测是开发环境改了该表的编码规则后没有更新到测试环境,故测试环境该表的编码和开发环境存在差异,进而导致在开发环境调试正常,但是在测试环境调试就报错。
即使那天已然升华,但愿初心不泯。
----------ccb_warlock
转载于:https://www.cnblogs.com/straycats/p/6955890.html
- 点赞
- 收藏
- 分享
- 文章举报
- c#程序连接mysql,报"Illegal mix of collations (utf8_general_ci,IMPLICIT) and (utf8_unicode_ci,IMPLICIT) for operation '='"的解决方案
- MYSQL莫名的 illegal mix of collations( utf8_unicode_ci, IMPLICIT) and (utf8_general_ci)
- Mysql Illegal mix of collations (utf8_unicode_ci,IMPLICIT) and (utf8_general_ci,IMPLICIT) for operation '='
- mysql: Illegal mix of collations (utf8_unicode_ci,IMPLICIT) and (utf8_general_ci,IMPLICIT) for operation '= 的解决
- mysql错误:Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE)
- Illegal mix of collations (utf8_unicode_ci,IMPLICIT) and (utf8_general_ci,IMPLICIT) for operation '=
- [Err] 1267 - Illegal mix of collations (utf8_general_ci,IMPLICIT) and (utf8_unicode_ci,IMPLICIT) for
- 处理【Illegal mix of collations (utf8_general_ci,IMPLICIT) and (utf8_unicode_ci,IMPLICIT) for operatio】
- MySQL Illegal mix of collations (latin1_swedish_ci,COERCIBLE) and (utf8_general_ci,IMPLICIT) for operation 'UNION' 错误解决方法
- Illegal mix of collations (utf8_general_ci,IMPLICIT) and (utf8_unicode_ci,IMPLICIT) for operation '=
- mysql错误提示Illegal mix of collations (gbk_chinese_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE)的一个解决办法
- Illegal mix of collations (utf8_unicode_ci,IMPLICIT) and (utf8_general_ci,IMPLICIT) for operation '
- Mysql: (1267, "Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COERCIBL
- Illegal mix of collations (utf8_general_ci,IMPLICIT) and (utf8_unicode_ci,IMPLIC神级解决方案
- Illegal mix of collations (utf8_unicode_ci,IMPLICIT) and (utf8_general_ci,IMPLICIT) for operation '=
- Illegal mix of collations (utf8_unicode_ci,IMPLICIT) and (utf8_general_ci,IMPLICIT) for operation '=
- 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_unicode_ci,IMPLICIT) and (utf8_general_ci,IMPLICIT) for operation '=
- Illegal mix of collations (utf8_unicode_ci,IMPLICIT) and (utf8_general_ci,IMPLICIT) for operation '=