当前位置:网站首页>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
边栏推荐
- 百家号取消接口发文功能:插外链获权重被堵死
- Flink optimization
- 我为何从开发人员转做测试,3年软件测试工程师,带你聊聊这其中的秘辛
- EasyV数字孪生流域|宁波智慧水利整体智治综合应用
- What is the relationship between the construction of smart cities and 5G technology in the new era
- 【Vue.js 3.0源码】KeepAlive 组件:如何让组件在内存中缓存和调度?
- BI-SQL丨WHILE
- 双碳目标下:农田温室气体排放模拟
- Cookie simulation login "recommended collection"
- pytorch与keras的相互转换(代码以LeNet-5为例)
猜你喜欢

What is the relationship between the construction of smart cities and 5G technology in the new era

JUC常见的线程池源码学习 02 ( ThreadPoolExecutor 线程池 )

canal scrape data

关于容器的小案例

MongoDB启动报错 Process: 29784 ExecStart=/usr/bin/mongod $OPTIONS (code=exited, status=14)

pytorch与keras的相互转换(代码以LeNet-5为例)

Use of SLF4J

Flask框架——Flask-SQLite数据库

3 years of software testing experience, the interview requires a monthly salary of 22K, obviously he has memorized a lot of interview questions...

A new generation of open source free terminal tools, so cool
随机推荐
闭包和装饰器
Six-faced ant financial clothing, resisting the bombardment of the interviewer, came to interview for review
ESP32 反复重启问题 Arduino屏蔽断电探测器
The main content of terrain analysis (the special effect level of the wandering earth)
3 years of software testing experience, the interview requires a monthly salary of 22K, obviously he has memorized a lot of interview questions...
怎么判断两个字符串是否相等?
为什么做软件测试一定要学自动化?谈谈我眼中自动化测试的价值
Cookie simulation login "recommended collection"
查阅所连接过的WiFi所有信息(含密码)(访问历史所有WiFi连接)
Teach you how to write an eye-catching software testing resume, if you don't receive an interview invitation, I will lose
Flask框架——Flask-Mail邮件
使用bat脚本以json格式导出mongo数据库中指定表数据
sql server安装失败怎么办(sql server安装不了怎么办)
Digital signal processing course lab report (what foundation is needed for digital signal processing)
跳槽前,把自己弄成卷王
BI-SQL丨WHILE
Meta首份元宇宙白皮书9大看点,瞄准80万亿美元市场
Android jump to google app market
从实例来看DAO:权力分散的伟大尝试
深入浅出零钱兑换问题——背包问题的套壳