ERROR 1205 (HY000): Lock wait timeout exceeded; try restarting transaction
测试库一条update语句报错:ERROR 1205 (HY000): Lock wait timeout exceeded; try restarting transaction
mysql> UPDATE profitloss_collect_form SET ApproveStatus = 2
-> WHERE formcode = 'SY2015111803' AND (
-> SELECT COUNT(8) FROM profitloss_collect_form_detail WHERE formcode = 'SY2015111803' AND checkstatus = 0
-> ) = 0;
ERROR 1205 (HY000): Lock wait timeout exceeded; try restarting transaction
update语句锁超时,一定是产生锁了。
mysql> select * from information_schema.innodb_trx\G
*************************** 1. row ***************************
trx_id: 3735875273
trx_state: RUNNING
trx_started: 2015-12-07 16:55:32
trx_requested_lock_id: NULL
trx_wait_started: NULL
trx_weight: 821
trx_mysql_thread_id: 40566656
trx_query: NULL
trx_operation_state: NULL
trx_tables_in_use: 0
trx_tables_locked: 0
trx_lock_structs: 817
trx_lock_memory_bytes: 95784
trx_rows_locked: 104599
trx_rows_modified: 4
trx_concurrency_tickets: 0
trx_isolation_level: REPEATABLE READ
trx_unique_checks: 1
trx_foreign_key_checks: 1
trx_last_foreign_key_error: NULL
trx_adaptive_hash_latched: 0
trx_adaptive_hash_timeout: 10000
trx_is_read_only: 0
trx_autocommit_non_locking: 0
*************************** 2. row ***************************
trx_id: 3731614168
trx_state: RUNNING
trx_started: 2015-12-07 11:14:59
trx_requested_lock_id: NULL
trx_wait_started: NULL
trx_weight: 0
trx_mysql_thread_id: 40317084
trx_query: insert into profitloss_collect_form_detail ........
trx_operation_state: NULL
trx_tables_in_use: 1
trx_tables_locked: 0
trx_lock_structs: 0
trx_lock_memory_bytes: 360
trx_rows_locked: 0
trx_rows_modified: 0
trx_concurrency_tickets: 0
trx_isolation_level: REPEATABLE READ
trx_unique_checks: 1
trx_foreign_key_checks: 1
trx_last_foreign_key_error: NULL
trx_adaptive_hash_latched: 0
trx_adaptive_hash_timeout: 10000
trx_is_read_only: 1
trx_autocommit_non_locking: 1
2 rows in set (0.00 sec)
mysql> kill 40317084;
ERROR 1205 (HY000): Lock wait timeout exceeded; try restarting transaction的更多相关文章
- ERROR 1205 (HY000): Lock wait timeout exceeded; try restarting transaction解决办法
一.问题描述: 同事反馈线上一个表有其中一条数据无法删除,其他都正常,我拿到删数据的sql,尝试执行,报错如下: mysql> delete from facebook_posts where ...
- ERROR 1205 (HY000): Lock wait timeout exceeded; try restarting transaction 表被锁的解决办法
转自:https://blog.csdn.net/mchdba/article/details/38313881 前言:朋友咨询我说执行简单的update语句失效,症状如下:mysql> upd ...
- Mysql错误:ERROR 1205 (HY000): Lock wait timeout exceeded; try restarting transaction
昨晚添加完索引之后, 查询整表的时候抛出Lock wait timeout exceeded; try restarting transaction, 吓死小白的我, 为什么条件查询可以, 整表查不了 ...
- 执行 update操作的时候有报错 ERROR 1205 (HY000): Lock wait timeout exceeded; try restarting transaction
mysql> show full processlist; #查看问题的线程!!!! 找到异常进程的ID 然后kill 掉: mysql> kill xxxxxxx; #xxxxxx是ID ...
- InternalError: (pymysql.err.InternalError) (1205, u'Lock wait timeout exceeded; try restarting transaction')
在mysql innodb中使用事务,如果插入或者更新出错,一定要主动显式地执行rollback,否则可能产生不必要的锁而锁住其他的操作 我们在使用数据库的时候,可以使用contextlib,这样异常 ...
- com.mysql.jdbc.exceptions.jdbc4.MySQLTransactionRollbackException: Lock wait timeout exceeded; try restarting transaction
本文为博主原创: 以下为在程序运行过程中报的错误, org.springframework.dao.CannotAcquireLockException: ### Error updating dat ...
- MySQL应用报错:java.sql.SQLException: Lock wait timeout exceeded; try restarting transaction
开发反馈,某业务系统插入一条记录的时候,日志报错,插入失败: ### Error updating database. Cause: java.sql.SQLException: Lock wait ...
- com.mysql.jdbc.exceptions.jdbc4.MySQLTransactionRollbackException: Lock wait timeout exceeded; try restarting transaction 问题解决
有两种设置方法 第一种在mysql的配置文件中加入,然后重启mysql innodb_lock_wait_timeout = 500 第二种直接执行如下命令 set global innodb_loc ...
- MySQL事务锁等待超时 Lock wait timeout exceeded; try restarting transaction
工作中处理定时任务分发消息时出现的问题,在查找并解决问题的时候,将相关的问题博客收集整理,在此记录下,以便之后再遇到相同的问题,方便查阅. 问题场景 问题出现的场景: 在消息队列处理消息时,同一事务内 ...
随机推荐
- 【JS对象、JSON字符串】之间的相互转换
在Firefox,chrome,opera,safari,ie9,ie8等浏览器直接可以用JSON对象的stringify()和parse()方法. 1.JSON.stringify(obj)将JS对 ...
- linux初学 :简易的shell脚本
什么是shell Shell本身是一个用C语言编写的程序,它是用户使用Unix/Linux的桥梁,用户的大部分工作都是通过Shell完成的 Shell有两种执行命令的方式: 交互式(Interacti ...
- 我关于SecureCRT远程连接失败的问题解决办法
使用VirtualBox搭建一个ubuntu14.04的系统环境,为了省去主机与虚拟机直接互相直接一直切换的频繁操作,所以想到了使用SecureCRT连接,但是出现了连接问题,问题如下图:
- localStorage的跨与实现方案
实现原理: HTML5 的 postMessage 为解决跨域页面通信提供了一套可控的机制, 而 localStorage 则提供了易用简洁的本地存储方案? 这两者结合起来,能否实现跨域的本地存储呢 ...
- hdu-5686 Problem B(斐波那契数列)
题目链接: Problem B Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) ...
- codeforces 675B B. Restoring Painting(暴力枚举)
题目链接: B. Restoring Painting time limit per test 1 second memory limit per test 256 megabytes input s ...
- Tarjan 离线算法LCA
#include<map> #include<set> #include<cmath> #include<queue> #include<cstd ...
- VB.NET 小程序 1
Public Class Form1 Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click ...
- CSS3--实现特殊阴影 (实例)
学习来源:慕课网http://www.imooc.com/view/240 先看效果图↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓ HTML结构 <body> <div class=& ...
- 项目中重新引用WCF报错
今天在一个项目里,重新更新WCF引用的时候,居然报错了,提示根本找不到那个WCF接口,我赶紧跑去新建了一个空项目,试着用相同的地址引用一下,发现是可以的,完全ok 既然是虚惊一场,那就得想办法把这个W ...