Illegal mix of collations (utf8_unicode_ci,IMPLICIT) and (utf8_general_ci,IMPLICIT) for operation '=
来源:互联网 发布:东方财富指标源码 编辑:程序博客网 时间:2024/06/03 12:47
今天在 mysql 中进行连表查询时提示:
错误代码: 1267
Illegal mix of collations (utf8_general_ci,IMPLICIT) and (utf8_unicode_ci,IMPLICIT) for operation ‘=’
创建数据库时选择的 COLLATION 是用在排序,大小比较上。一个字符集有一个或多种 collation,并且以_ci(大小写不敏感)、_cs(大小写敏感)或 _bin(二元)结束。在做比较时,应该确保两个表的字符排序相同。一般建表的时候不指定,可以走默认的,全是默认的就没什么问题了。
解决方法:
只要修改一下表的字符集就可以了,如下:
ALTER TABLE problem_order CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
1.列出MYSQL支持的所有字符集:
SHOW CHARACTER SET;
2.当前MYSQL服务器字符集设置
SHOW VARIABLES LIKE ‘character_set_%’;
3.当前MYSQL服务器字符集校验设置
SHOW VARIABLES LIKE ‘collation_%’;
4.显示某数据库字符集设置
show create database 数据库名;
5.显示某数据表字符集设置
show create table 表名;
6.修改数据库字符集
alter database 数据库名default character set ‘utf8’;
7.修改数据表字符集
alter table 表名default character set ‘utf8’;
8.建库时指定字符集
create database 数据库名character set gbk collate gbk_chinese_ci;
9.建表时指定字符集
CREATE TABLE mysqlcode
(
id
TINYINT( 255 ) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY ,
content
VARCHAR( 255 ) NOT NULL
) TYPE = MYISAM CHARACTER SET gbk COLLATE gbk_chinese_ci;
- 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_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_unicode_ci,IMPLICIT) and (utf8_general_ci,IMPLICIT) for operation '
- Illegal mix of collations (utf8_general_ci,IMPLICIT) and (utf8_unicode_ci,IMPLICIT) for operation '
- Illegal mix of collations (utf8_general_ci,IMPLICIT) and (utf8_unicode_ci,IMPLICIT)
- Illegal mix of collations (gbk_chinese_ci,IMPLICIT) and (utf8_unicode_ci,IMPLICIT) for operation '='
- 处理【Illegal mix of collations (utf8_general_ci,IMPLICIT) and (utf8_unicode_ci,IMPLICIT) for operatio】
- 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 (utf8_unicode_ci,IMPLIC
- Illegal mix of collations (utf8_general_ci,IMPLICIT) and (utf8_unicode_ci,IMPLIC
- 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 '='
- Error Code: 1267. Illegal mix of collations (utf8_unicode_ci,IMPLICIT) and (utf8_general_ci,IMPLICIT
- Mysql编码引起的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) for operation 'like'
- 测试使用csdn的markdown
- PostgreSQL的MVCC并发处理方式
- leetcode 257. Binary Tree Paths(DFS)
- opengl fbo离屏渲染,处理Android截屏卡顿太久。
- JACK_C#_内存分配
- Illegal mix of collations (utf8_unicode_ci,IMPLICIT) and (utf8_general_ci,IMPLICIT) for operation '=
- OpenCV2.4.13 中 选取roi区域,任意形状(矩形,不规则多边形,圆形,椭圆,手动指定形状)
- sharedperferences 记住密码,自动登录demo
- JVM结构
- const变量通过指针修改 详解
- VIVADO布线布不通过描述
- 如何在谷歌浏览器查看axure文件
- 栈和队列的经典面试题(一)
- 常见框架中的单例、多例与线程安全性总结