digdeep

凡是过去,皆是序幕。Read the fucking manual and source code.

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

tomcat日志报错:

org.springframework.dao.QueryTimeoutException:
### Error querying database. Cause: com.mysql.jdbc.exceptions.MySQLTimeoutException: Statement cancelled due to timeout or client request
### The error may exist in file [/var/lib/tomcat8/webapps/ROOT/WEB-INF/classes/mappers/DeviceMapper.xml]
### The error may involve defaultParameterMap
### The error occurred while setting parameters

原因是,MySQL优化器执行计划 使用了错误的索引,导致一条SQL查询语句超时,需要30多秒,所以报错。

解决方法是使用 force index 提示 mysql 选择正确的索引。搞定。

posted on 2020-04-08 23:34  digdeep  阅读(6031)  评论(0编辑  收藏  举报
不懂数据库和Web安全的架构师不是一个好的程序员。