当前位置:网站首页>Lock wait timeout exceeded解决方案
Lock wait timeout exceeded解决方案
2022-07-31 05:08:00 【m0_67401920】
[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
先自我介绍一下,小编13年上师交大毕业,曾经在小公司待过,去过华为OPPO等大厂,18年进入阿里,直到现在。深知大多数初中级java工程师,想要升技能,往往是需要自己摸索成长或是报班学习,但对于培训机构动则近万元的学费,着实压力不小。自己不成体系的自学效率很低又漫长,而且容易碰到天花板技术停止不前。因此我收集了一份《java开发全套学习资料》送给大家,初衷也很简单,就是希望帮助到想自学又不知道该从何学起的朋友,同时减轻大家的负担。添加下方名片,即可获取全套学习资料哦
边栏推荐
- 【MQ我可以讲一个小时】
- MySQL优化:从十几秒优化到三百毫秒
- 面试Redis 高可靠性|主从模式、哨兵模式、Cluster集群模式
- STM32——DMA
- Numpy中np.meshgrid的简单用法示例
- 参考代码系列_1.各种语言的Hello World
- Goodbye to the cumbersome Excel, mastering data analysis and processing technology depends on it
- The 15th day of the special assault version of the sword offer
- DVWA之SQL注入
- 【mysql 提高查询效率】Mysql 数据库查询好慢问题解决
猜你喜欢

Heavyweight | The Open Atomic School Source Line activity was officially launched

1. 获取数据-requests.get()

Simple read operation of EasyExcel

The MySQL database installed configuration nanny level tutorial for 8.0.29 (for example) have hands

MySQL8.0安装教程,在Linux环境安装MySQL8.0教程,最新教程 超详细

Interview | Cheng Li, CTO of Alibaba: Cloud + open source together form a credible foundation for the digital world

太厉害了,终于有人能把文件上传漏洞讲的明明白白了

MySQL事务隔离级别详解

sql statement - how to query data in another table based on the data in one table

mysql使用on duplicate key update批量更新数据
随机推荐
.NET-9.乱七八糟的理论笔记(概念,思想)
PCL calculates the point cloud coordinate maximum and its index
Mysql application cannot find my.ini file after installation
12 reasons for MySQL slow query
【mysql 提高查询效率】Mysql 数据库查询好慢问题解决
质量小议12 -- 以测代评
ERROR 1819 (HY000) Your password does not satisfy the current policy requirements
DVWA installation tutorial (understand what you don't understand · in detail)
MySQL优化之慢日志查询
【MySQL8入门到精通】基础篇- Linux系统静默安装MySQL,跨版本升级
Lua,ILRuntime, HybridCLR(wolong)/huatuo热更新对比分析
Error EPERM operation not permitted, mkdir 'Dsoftwarenodejsnode_cache_cacach Two solutions
精解四大集合框架:List 核心知识总结
[Cloud Native] DevOps (5): Integrating Harbor
【ORACLE Explain 详解】
mysql存储过程
STM32——DMA
MySQL database backup
Unity手机游戏性能优化系列:针对CPU端的性能调优
MySQL忘记密码怎么办