当前位置:网站首页>Mysql频繁操作出现锁表问题
Mysql频繁操作出现锁表问题
2022-07-05 20:14:00 【幼儿园里的山大王】
一、报错现象
org.springframework.dao.CannotAcquireLockException:
### Error updating database. Cause: com.mysql.cj.jdbc.exceptions.MySQLTransactionRollbackException: Lock wait timeout exceeded; try restarting transaction
这个错误是由于有线程或者是有其他操作在频繁的操作mysql数据库导致表被锁了。
二、解决方式
1、在数据库中执行下面语句。
SELECT * FROM INFORMATION_SCHEMA.INNODB_TRX;
会出现
2、然后找到 trx_mysql_thread_id 列
使用kill id;删除掉对应线程id即可解决。
边栏推荐
猜你喜欢
About the priority of Bram IP reset
Convolution free backbone network: Pyramid transformer to improve the accuracy of target detection / segmentation and other tasks (with source code)
Build your own website (16)
Autumn byte interviewer asked you any questions? In fact, you have stepped on thunder
Go language | 01 wsl+vscode environment construction pit avoidance Guide
信息学奥赛一本通 1339:【例3-4】求后序遍历 | 洛谷 P1827 [USACO3.4] 美国血统 American Heritage
leetcode刷题:二叉树13(相同的树)
leetcode刷题:二叉树11(平衡二叉树)
leetcode刷题:二叉树15(找树左下角的值)
[quick start to digital IC Verification] 8. Typical circuits in digital ICs and their corresponding Verilog description methods
随机推荐
y57.第三章 Kubernetes从入门到精通 -- 业务镜像版本升级及回滚(三十)
model方法
July 4, 2022 - July 10, 2022 (UE4 video tutorial MySQL)
c语言oj得pe,ACM入门之OJ~
Leetcode(347)——前 K 个高频元素
leetcode刷题:二叉树13(相同的树)
字节跳动Dev Better技术沙龙成功举办,携手华泰分享Web研发效能提升经验
Is the education of caiqiantang reliable and safe?
《乔布斯传》英文原著重点词汇笔记(十二)【 chapter ten & eleven】
leetcode刷题:二叉树15(找树左下角的值)
【c语言】归并排序
Schema和Model
Based on vs2017 and cmake GUI configuration, zxing and opencv are used in win10 x64 environment, and simple detection of data matrix code is realized
Notes on key vocabulary in the English original of the biography of jobs (12) [chapter ten & eleven]
Leetcode brush questions: binary tree 18 (largest binary tree)
mongodb/文档操作
[quick start to digital IC Verification] 8. Typical circuits in digital ICs and their corresponding Verilog description methods
微信小程序正则表达式提取链接
mongodb文档间关系
零道云新UI设计中