mysql 死锁超时参数_mysql-什么时候InnoDB超时而不是报告死锁?

一个提示是,您可以使用SHOW INNODB STATUS来显示InnoDB引擎的状态.

它返回的信息(大块文本)包括有关当前表锁的信息,以及最后检测到的死锁(在标题为“ LATEST DETECTED DEADLOCK”下),因此,在此事实之后,此技巧并不是很有用,但是可以帮助您跟踪挂起的查询.

mysqladmin debug还可以打印有用的锁调试信息.

HTH!

更新:

因为它实际上不是死锁,所以它可能没有检测到死锁,但是更有可能一个进程正在等待另一进程锁定的行上的行锁.从手册中获取innodb_lock_wait_timeout变量:

The timeout in seconds an InnoDB

transaction may wait for a row lock

before giving up. The default value is

50 seconds. A transaction that tries

to access a row that is locked by

another InnoDB transaction will hang

for at most this many seconds before

issuing the following error:

ERROR 1205 (HY000): Lock wait timeout

exceeded; try restarting transaction

When a lock wait timeout occurs, the

current statement is not executed. The

current transaction is not rolled

back. (Until MySQL 5.0.13 InnoDB

rolled back the entire transaction if

a lock wait timeout happened.

例如,当两个进程各自需要锁定由另一个进程锁定的行时,就会发生死锁,并且没有任何等待量可以解决冲突.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值