Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation

简介: Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation

1、出现问题

查询数据时报如题错误

2、解决方案

建表时需指定字符集,例如:

-- ----------------------------
-- Table structure for testTable
-- ----------------------------
CREATE TABLE testTable(
    Id BIGINT(20) NOT NULL   COMMENT '主键' ,
    Name VARCHAR(200) NOT NULL   COMMENT '名称' ,
    InUserId BIGINT(20) NOT NULL   COMMENT '添加人Id' ,
    InName VARCHAR(20) NOT NULL   COMMENT '添加人' ,
    InTime BIGINT(20) NOT NULL   COMMENT '添加时间' ,
    UpUserId BIGINT(20) NOT NULL   COMMENT '修改人Id' ,
    UpName VARCHAR(50) NOT NULL   COMMENT '修改人' ,
    UpTime BIGINT(20) NOT NULL   COMMENT '修改时间' ,
    PRIMARY KEY (Id )
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='测试表';

image.gif

以上就是Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation的介绍,做此记录,如有帮助,欢迎点赞关注收藏!

目录
相关文章
|
4月前
|
关系型数据库 MySQL 数据库
Unknown collation: ‘utf8mb4_0900_ai_ci‘
Unknown collation: ‘utf8mb4_0900_ai_ci‘
|
SQL 关系型数据库 MySQL
Mysql报错:Illegal mix of collations (utf8mb4_bin,NONE) and (utf8mb4_0900_ai_ci,IMPLICIT) for operation
Mysql报错:Illegal mix of collations (utf8mb4_bin,NONE) and (utf8mb4_0900_ai_ci,IMPLICIT) for operation
568 0
|
SQL 存储 关系型数据库
CHARACTER SET utf8 COLLATE utf8_general_ci
CHARACTER SET utf8 COLLATE utf8_general_ci
|
关系型数据库 MySQL Shell
[ERROR] COLLATION ‘utf8_unicode_ci‘ is not valid for CHARACTER SET ‘latin1‘
[ERROR] COLLATION ‘utf8_unicode_ci‘ is not valid for CHARACTER SET ‘latin1‘
|
SQL 关系型数据库 MySQL
解决:[Err] 1273 - Unknown collation: ‘utf8mb4_0900_ai_ci‘
记录如何结局:[Err] 1273 - Unknown collation: ‘utf8mb4_0900_ai_ci’这个问题
467 1
解决:[Err] 1273 - Unknown collation: ‘utf8mb4_0900_ai_ci‘
|
关系型数据库 MySQL 数据库
Mysql case 视图操作报错 1267 Illegal mix of collations (utf8mb4_unicode_ci,COERCIBLE)……
Mysql case 视图操作报错 1267 Illegal mix of collations (utf8mb4_unicode_ci,COERCIBLE)……
238 0
Mysql case 视图操作报错 1267 Illegal mix of collations (utf8mb4_unicode_ci,COERCIBLE)……
|
数据库
Illegal mix of collations (utf8_general_ci,IMPLICIT) and (utf8mb4_general_ci,COERCIBLE)
版权声明:本文为 testcs_dn(微wx笑) 原创文章,非商用自由转载-保持署名-注明出处,谢谢。 https://blog.csdn.net/testcs_dn/article/details/82016025 Illegal mix of collations (utf8_general_ci,IMPLICIT) and (utf8mb4_general_ci,COERCIBLE) for operation 'like' 这个问题一看就是编码的问题。
6338 0
|
人工智能
Arrival of the General
Arrival of the General
93 0
Arrival of the General
|
SQL 关系型数据库 MySQL
mysql: Illegal mix of collations (utf8_unicode_ci,IMPLICIT) and (utf8_general_ci,IMPLICIT) for operation '= 的解决
昨天把mysql里所有table的varchar字段的字符集,批量换成了utf8mb4/utf8mb4_unicode_ci ,以便能保存一些emoji火星文 , 结果有一个sql语句执行时,报错如下: Illegalmixofcollations (utf8_unicode_ci,IMPLICI...
2132 0