事情是这样晒的,有两个独立部署的web服务器环境A和B,A的数据库和B的数据库几乎是一样的(库、表、字段、数据),也有可能没发现不一样的地方。A正常,B请求异常,如下所示:
### Error querying database. Cause: java.sql.SQLException: Illegal mix of collations (utf8mb4_general_ci,COERCIBLE) and (latin1_swedish_ci,NUMERIC) for operation '<=' ### The error may exist in URL [jar:file:/data/yangtun_show/6_cgp/scp-cgp.jar!/BOOT-INF/classes!/mapper/CaseRegistrationMapper.xml] ### The error may involve com.bjzhianjia.scp.cgp.mapper.CaseRegistrationMapper.getStatisByDept-Inline ### The error occurred while setting parameters ###
SQL: xxxxxxx and ?<=crt_time and crt_time <= ? and yyyyyyyyyyy### Cause: java.sql.SQLException: Illegal mix of collations (utf8mb4_general_ci,COERCIBLE) and (latin1_swedish_ci,NUMERIC) for operation '<=' ; uncategorized SQLException for SQL []; SQL state [HY000]; error code [1267]; Illegal mix of collations (utf8mb4_general_ci,COERCIBLE) and (latin1_swedish_ci,NUMERIC) for operation '<='; nested exception is java.sql.SQLException: Illegal mix of collations (utf8mb4_general_ci,COERCIBLE) and (latin1_swedish_ci,NUMERIC) for operation '<=
这样的问题出现了,好像没见过(不要慌,拿起想起拍个照,然后发个朋友圈)。定位问题需要从头开始,哪个个web接口发起的请求,后台做了什么处理,数据库执行的时候SQL现场是什么样子的。
思路有了,开始在B中还原现场。从web发起请求的接口是http://i.love.you:forever/queryPath?startTime=2020-04-00+00:17:16&endTime=2020-07-22+00:17:16,复盘成功。发现了奇怪的地方,请求参数中startTime=2020-04-00+00:17:1有00,换成01试试http://i.love.you:forever/queryPath?startTime=2020-04-01+00:17:16&endTime=2020-07-22+00:17:16,成功了。 问题解决了!
Illegal mix of collations (utf8mb4_general_ci,COERCIBLE) and (latin1_swedish_ci,NUMERIC) for operation '<='; 看来并不可怕,但是。。。。。。
why?A行,B不行原因是什么呢?
应该有两种可能性:第一是web程序对日期解析支持不同,可能受操作系统影响;第二是数据库本身支持对异常日期的解析。
继续探索。。。
分享到:
相关推荐
主要介绍了MySQL 编码utf8 与 utf8mb4 utf8mb4_unicode_ci 与 utf8mb4_general_ci的相关知识,本文通过实例代码给大家介绍的非常详细,对大家的学习或工作具有一定的参考借鉴价值,需要的朋友可以参考下
今天帮同事处理一个SQL(简化过后的)执行...ERROR 1267 (HY000): Illegal mix of collations (utf8_general_ci,COERCIBLE) and (latin1_swedish_ci,NUMERIC) for operation ‘>’ 乍一看挺莫名其妙的,查了下手册,
mysql数据库和中文支持很不友好,经常见到“Illegal mix of collations for operation”错误,该如何解决呢?下面小编给大家带来了mysql数据库中涉及到哪些字符集及彻底解决中文乱码的解决方案,非常不错,一起看看...
swedish_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation '=' 这个错误,所以在stackover flow 中找到了对这个数据库,以及数据表中进行更改字符集的方法。 SET collation_connection
Illegal mix of collations (utf8_unicode_ci,IMPLICIT) and (utf8_general_ci,IMPLICIT) for operation '= 所以,自己把还没产生数据的表都删除,重新建立ut8表 此文件sql语句都是没产生数据的表,直接可以用py或者...
ERROR 1267 (HY000): Illegal mix of collations (utf8_general_ci,COERCIBLE) and (latin1_swedish_ci,NUMERIC) for operation '>' 乍一看挺莫名其妙的,查了下手册,发现有这么一段: The language us
MySQL多表join时报错如下:[Err]1267 – Illegal mix of collations(utf8_general_ci,IMPLICIT) and (utf8_unicode_ci,IMPLICIT) for operation ‘= 就是说两个表的排序规则(COLLATION)不同,无法完成比较。...
技术点整理所用到的技术点并方便自己近期翻看巩固小程序的登录(wx.getUserInfo()接口调整)mysql命令(knex)新增、查询、联表查询小程序获取地理...list时遇到mysql错误错误提示'Illegal mix of collations (utf8mb4...
illegal key size org.apache.ws .security.components.crypto.Merlin cannot create instance
Undocumented_Secrets_of_MATLAB_Java_Programming.part2 Undocumented_Secrets_of_MATLAB_Java_... As far as I know, everything in this book is legal and within the bounds of the Matlab license agreement.
Undocumented_Secrets_of_MATLAB_Java_Programming.part3 Undocumented_Secrets_of_MATLAB_Java_... As far as I know, everything in this book is legal and within the bounds of the Matlab license agreement.
今日遇到如下错误:java.security.InvalidKeyException: Illegal key size 因为美国法律限制,JAVA默认支持AES 128 Bit 的key, 如果你计划使用 192 Bit 或者 256 Bit key, java complier 会抛出 Illegal key size ...
At least once in every online description and with reasonable duration on the opening screen, your Variations must prominently identify (i) the names and email addresses of its creators, and (ii) the...
Mysql关联两张表时,产生错误提示Illegal mix of collations 1、先用工具把数据库、两张表的编码方式改变 2、这步很重要,需要改变字段的编码方式。 ALTER TABLE `表名` CHANGE `dev_chancode` `字段` VARCHAR(32) ...
JDK8 环境下,处理微信退款回调时报错 Illegal key size or default parameters。 将local_policy.jar和US_export_policy.jar这两个文件替换%JRE_HOME%\lib\security和%JDK_HOME%\jre\lib\security下原来的文件,...
面向Linux平台的违规外联监控系统的主要架构和关键技术,郭峰,崔翔,为了保护涉密网络的安全,目前采取的主要措施是物理上的隔离。这种方法可以减少来自外部网络的安全威胁。然后,涉密网络内部同样
partI Writing (30 minute) <br>注意:此部分试题在答题卡1上。 <br>Directions:For this part ,you are allowed 30minute to write a short essay on the topic of students selecting their fectures....
复制并覆盖%JAVA_HOME%/jre/lib/security下的local_policy.jar 和 US_export_policy.jar
SCGCQ00531245 (ENHREQ) - Display the NCQ enabled/disabled status of every SATA disk drive in output of StorCLI and MegaCLI SCGCQ00552754 (ENHREQ) - RAID CLI to display the Patrol Read Start Time SCGCQ...