需要在不重启数据库的情况下清除MySQL InnoDB锁

前端之家收集整理的这篇文章主要介绍了需要在不重启数据库的情况下清除MySQL InnoDB锁前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我有一个 MySQL InnoDB锁阻止用户登录.我不关心此锁的原因 – 我只需要清除锁而不重新启动数据库.杀死查询过程不做任何事情.有什么建议?谢谢.

解决方法

以下是我如何解决问题:
MysqL> show engine innodb status\G
*************************** 1. row ***************************
  Type: InnoDB
  Name: 
Status: 
=====================================
120710 18:05:37 INNODB MONITOR OUTPUT
=====================================
Per second averages calculated from the last 37 seconds
----------
SEMAPHORES
----------
OS WAIT ARRAY INFO: reservation count 208374,signal count 196902
Mutex spin waits 0,rounds 39211638,OS waits 80663
RW-shared spins 588505,OS waits 68505; RW-excl spins 3204502,OS waits 53586
------------
TRANSACTIONS
------------
Trx id counter 1 3626791829
Purge done for trx's n:o < 1 3625948819 undo n:o < 0 0
History list length 6754
LIST OF TRANSACTIONS FOR EACH SESSION:
...
---TRANSACTION 1 3625948818,ACTIVE 2892 sec,process no 1981,OS thread id 140020625811200
2 lock struct(s),heap size 368,1 row lock(s),undo log entries 1

>>>>> MysqL thread id 14982,query id 232584561 localhost dbuser

Trx read view will not see trx with id >= 1 3625948819,sees < 1 3625948817

MysqL> kill 14982;
Query OK,0 rows affected (0.00 sec)

请注意,带有>>>>>的行是定义MysqL线程ID的地方 – 应该杀死这个线程.

请参阅this帖子 – 非常有用.

原文链接:https://www.f2er.com/mssql/75295.html

猜你在找的MsSQL相关文章