当前位置:网站首页>Lock wait timeout exceeded解决方案
Lock wait timeout exceeded解决方案
2022-07-30 14:26:00 【web18484626332】
[Err] 1205 - Lock wait timeout exceeded; try restarting transaction
基本原因:后提交的事务等待前面处理的事务释放锁,但是在等待的时候超过了mysql的锁等待时间,就会引发这个异常。
1.通过到information_schema中来进行查找被锁的语句
information_schema这张数据表保存了MySQL服务器所有数据库的信息。如数据库名,数据库的表,表栏的数据类型与访问权限等。再简单点,这台MySQL服务器上,到底有哪些数据库、各个数据库有哪些表,每张表的字段类型是什么,各个数据库要什么权限才能访问,等等信息都保存在information_schema表里面。
mysql 8之前的版本:information_schema
innodb_trx当前运行的所有事务innodb_locks当前出现的锁innodb_lock_waits锁等待的对应关系
select * from information_schema.innodb_trx;
select * from information_schema.innodb_locks;
select * from information_schema.innodb_locks_waits;
mysql 8.0之后的版本:performance_schema
innodb_trx当前运行的所有事务innodb_locks当前出现的锁innodb_lock_waits锁等待的对应关系
select * from information_schema.innodb_trx;
select * from performance_schema.data_locks;
select * from performance_schema.data_lock_waits;
2.查询数据库中有锁
select * from information_schema.innodb_trx;
记录状态为“RUNNING” 即正在执行的事务,并没有锁

3.显示正在运行的线程
show full processlist;

然后找出查询语句的系统id:kill掉被锁住的线程id
kill 5
边栏推荐
- Web消息推送之SSE
- MaxWell抓取数据
- 吃透Chisel语言.29.Chisel进阶之通信状态机(一)——通信状态机:以闪光灯为例
- Interface automation framework, lm-easytest beta version released, use it quickly~
- Why did I switch from developer to testing, 3 years software testing engineer, tell you the secret of this
- [深入研究4G/5G/6G专题-46]: 5G Link Adaption链路自适应-2-常见缩略语
- MySQL客户端工具的使用与MySQL SQL语句
- 00后测试员摸爬滚打近一年,为是否要转行或去学软件测试的学弟们总结出了以下走心建议
- 元宇宙邮局AI航天主题系列数字藏品 将于7月30日10:00点上线“元邮数藏”
- 00 testers of seasoning after nearly a year, whether to change careers or to learn the software testing students summarized the following heart advice
猜你喜欢

MongoDB starts an error Process: 29784 ExecStart=/usr/bin/mongod $OPTIONS (code=exited, status=14)

Flask框架——Sijax

Understand Chisel language. 28. Chisel advanced finite state machine (2) - Mealy state machine and comparison with Moore state machine

Eight years of testing experience, why was the leader criticized: the test documents you wrote are not as good as those of fresh graduates

去腾讯面试,直接让人出门左拐 :幂等性都不知道!

吃透Chisel语言.28.Chisel进阶之有限状态机(二)——Mealy状态机及与Moore状态机的对比

Six-faced ant financial clothing, resisting the bombardment of the interviewer, came to interview for review

The truth of the industry: I will only test those that have no future, and I panic...

桌面软件开发框架大赏

The evolution of content products has three axes: traffic, technology, and product form
随机推荐
获取Google Advertising ID作为唯一识别码
Some thoughts on String
地形分析的主要内容(流浪地球的特效水平)
去腾讯面试,直接让人出门左拐 :幂等性都不知道!
国内数字藏品的乱象与未来
跳槽前,把自己弄成卷王
Android jump to google app market
智能合约安全——私有数据访问
Eight years of testing experience, why was the leader criticized: the test documents you wrote are not as good as those of fresh graduates
Why do software testing have to learn automation?Talk about the value of automated testing in my eyes
DocuWare 文件管理与工作流程自动化案例研究——DocuWare 工作流程功能使在家工作的员工能够保持沟通和高效工作,支持混合环境
分布式限流 redission RRateLimiter 的使用及原理
【回归预测-CNN预测】基于卷积神经网络CNN实现数据回归预测附matlab代码
网站添加能换装可互动的live 2d看板娘
3年软件测试经验面试要求月薪22K,明显感觉他背了很多面试题...
The highest level of wiring in the computer room, the beauty is suffocating
A new generation of open source free terminal tools, so cool
2022年,目前大环境下还适合转行软件测试吗?
Eclipse connects to SQL server database "recommended collection"
记面试外包公司的一次经历,到底该不该去?