当前位置:网站首页>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
边栏推荐
- Meta首份元宇宙白皮书9大看点,瞄准80万亿美元市场
- 深入浅出零钱兑换问题——背包问题的套壳
- How to use Databricks for data analysis on TiDB Cloud | TiDB Cloud User Guide
- 获取Google Advertising ID作为唯一识别码
- eclipse连接SQL server数据库「建议收藏」
- 网站添加能换装可互动的live 2d看板娘
- SSE for Web Message Push
- Allure进阶-动态生成报告内容
- 从实例来看DAO:权力分散的伟大尝试
- What should I do if the sql server installation fails (what should I do if the sql server cannot be installed)
猜你喜欢

我为何从开发人员转做测试,3年软件测试工程师,带你聊聊这其中的秘辛

Why do software testing have to learn automation?Talk about the value of automated testing in my eyes

华为7年经验的软件测试总监,给所有想转行学软件测试的朋友几点建议

双碳目标下:农田温室气体排放模拟

2022年,目前大环境下还适合转行软件测试吗?

This editor actually claims to be as fast as lightning!

A Small Case About Containers

Flask框架——Flask-SQLite数据库

Smart Contract Security - Private Data Access

Meta首份元宇宙白皮书9大看点,瞄准80万亿美元市场
随机推荐
自动化办公|办公软件和亿图脑图MindMaster快捷键
Flink real-time data warehouse completed
【Vue.js 3.0源码】KeepAlive 组件:如何让组件在内存中缓存和调度?
新时代背景下智慧城市的建设与5G技术有何关联
Start learning C language
MaxWell抓取数据
[机缘参悟-53]:《素书》-3-修身养志[求人之志章第三]
pytorch与keras的相互转换(代码以LeNet-5为例)
Conversion between pytorch and keras (the code takes LeNet-5 as an example)
Still saying software testing doesn't have a midlife crisis?9 years of test engineers were eliminated
SLF4J的使用
The highest level of wiring in the computer room, the beauty is suffocating
canal scrape data
百家号取消接口发文功能:插外链获权重被堵死
Flink优化
六面蚂蚁金服,抗住面试官的狂轰乱炸,前来面试复盘
数字信号处理课程实验报告(数字信号处理需要什么基础)
Meta首份元宇宙白皮书9大看点,瞄准80万亿美元市场
ECCV 2022 | Towards Data Efficient Transformer Object Detectors
Flask框架——Sijax