当前位置:网站首页>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开发全套学习资料》送给大家,初衷也很简单,就是希望帮助到想自学又不知道该从何学起的朋友,同时减轻大家的负担。添加下方名片,即可获取全套学习资料哦
边栏推荐
- 面试Redis 高可靠性|主从模式、哨兵模式、Cluster集群模式
- <urlopen error [Errno 11001] getaddrinfo failed>的解决、isinstance()函数初略介绍
- Blockbuster | foundation for platinum, gold, silver gave nameboards donors
- 分布式事务——分布式事务简介、分布式事务框架 Seata(AT模式、Tcc模式、Tcc Vs AT)、分布式事务—MQ
- Unity mobile game performance optimization series: performance tuning for the CPU side
- MySQL8.0安装教程,在Linux环境安装MySQL8.0教程,最新教程 超详细
- 太厉害了,终于有人能把文件上传漏洞讲的明明白白了
- The 15th day of the special assault version of the sword offer
- TOGAF之架构标准规范(一)
- SQL行列转换
猜你喜欢
随机推荐
矩池云快速安装torch-sparse、torch-geometric等包
centos7安装mysql5.7
Unity mobile game performance optimization series: performance tuning for the CPU side
CentOS7 - yum install mysql
再见了繁琐的Excel,掌握数据分析处理技术就靠它了
mysql uses on duplicate key update to update data in batches
Go language study notes - dealing with timeout problems - Context usage | Go language from scratch
Numpy中np.meshgrid的简单用法示例
Pytorch教程Introduction中的神经网络实现示例
The MySQL database installed configuration nanny level tutorial for 8.0.29 (for example) have hands
面试官:生成订单30分钟未支付,则自动取消,该怎么实现?
Lua,ILRuntime, HybridCLR(wolong)/huatuo热更新对比分析
[R language] [3] apply, tapply, lapply, sapply, mapply and par function related parameters
DVWA安装教程(懂你的不懂·详细)
12 reasons for MySQL slow query
Mysql application cannot find my.ini file after installation
Distributed Transactions - Introduction to Distributed Transactions, Distributed Transaction Framework Seata (AT Mode, Tcc Mode, Tcc Vs AT), Distributed Transactions - MQ
ERROR 2003 (HY000) Can't connect to MySQL server on 'localhost3306' (10061)
CentOS7 安装MySQL 图文详细教程
MySQL忘记密码怎么办