mysql - 遇到问题 : Illegal mix of collations in MySQL

标签 mysql collation

我已经写了这个查询

select * 
from order mbo 
where  storeId in(select storeid 
                  from store bs 
                  INNER JOIN  distributioncenter bd
                    on bd.distributionCenterId = bs.distributionCenterId            
                  where (bd.orderCloseTime > curtime() and date(bo.orderDate)>=date(now())
                     and bs.storeId=1112211)  
                   or (date(bo.orderDate)>date(now())and bs.storeId=1112211));

这个查询在我的本地运行良好,但在其他同事的系统中我遇到了以下问题。

Illegal mix of collations (utf8_general_ci,IMPLICIT) and (latin1_swedish_ci,NUMERIC) for operation '>';

可能是什么问题?

最佳答案

在你的mysql数据库中,“SHOW VARIABLES LIKE 'character_set_%'”,确保它们都是“UTF8”

关于mysql - 遇到问题 : Illegal mix of collations in MySQL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45207543/

相关文章:

mysql - 在mysql中选择不同的2列组合

sql - 在不更改排序规则的情况下更改列

MySQL 5.7.7 排序规则 'hebrew_general_ci' 对字符集 'utf8' 无效

php - Postman php 数据库错误

php - Ajax 代码无法正常工作,即使它(我认为)是正确的

mysql - 在mysql数据库中存储瑞典语字符

MySQL 与 varchars 和 literals 的等效比较——不区分大小写,自动调整

MySQL 排序 : how to make Cyrillic characters go before Latin characters?

mysql - 如何编写用于在 sqlite 数据库中拆分、提取的选择查询?

mysql - (codeigniter) 将多行数据从文件添加到mysql数据库?