亚洲视频二区_亚洲欧洲日本天天堂在线观看_日韩一区二区在线观看_中文字幕不卡一区

公告:魔扣目錄網為廣大站長提供免費收錄網站服務,提交前請做好本站友鏈:【 網站目錄:http://www.430618.com 】, 免友鏈快審服務(50元/站),

點擊這里在線咨詢客服
新站提交
  • 網站:51998
  • 待審:31
  • 小程序:12
  • 文章:1030137
  • 會員:747

第一種

#1.查詢是否鎖表

MySQL> show OPEN TABLES where In_use > 0;

#2.查詢進程(如果您有SUPER權限,您可以看到所有線程。否則,您只能看到您自己的線程)

mysql> show full processlist;

#3.殺死進程id(就是上面命令的id列)

[linux-command] kill id;

第二種

#1.查看正在鎖的事務

mysql> select * from information_schema.innodb_trx;

#2.殺死進程id(就是上面命令的trx_mysql_thread_id列)

mysql> show processlist;

[linux-command] kill 420821

#3.查找執行事務的客戶端請求的SQL線程

mysql> select * from information_schema.processlist where id=76613;

#4.通過SQL線程,找到應用程序的IP地址以及端口192.168.10.1:23452

[linux-command].NETstat -nlatp |grep 23452

[linux-command] ps -eaf|grep 12059

其它關于查看死鎖的命令

#1:查看當前的事務

select * from information_schema.innodb_trx;

#2:查看當前鎖定的事務

select * from information_schema.innodb_locks;

#3:查看當前等鎖的事務

select * from information_schema.innodb_lock_waits;

#4:查看鎖表情況

select r.trx_id as waiting_trx_id,

r.trx_mysql_thread_id as waiting_thread,

r.trx_query as waiting_query,

b.trx_id as blocking_trx_id,

b.trx_mysql_thread_id as blocking_thread,

b.trx_query as blocking_query,

(UNIX_TIMESTAMP() - UNIX_TIMESTAMP(b.trx_started)) as block_time

from information_schema.innodb_lock_waits w

inner join information_schema.innodb_trx b on b.trx_id = w.blocking_trx_id

inner join information_schema.innodb_trx r on r.trx_id = w.requesting_trx_id;

分享到:
標簽:MySQL
用戶無頭像

網友整理

注冊時間:

網站:5 個   小程序:0 個  文章:12 篇

  • 51998

    網站

  • 12

    小程序

  • 1030137

    文章

  • 747

    會員

趕快注冊賬號,推廣您的網站吧!
最新入駐小程序

數獨大挑戰2018-06-03

數獨一種數學游戲,玩家需要根據9

答題星2018-06-03

您可以通過答題星輕松地創建試卷

全階人生考試2018-06-03

各種考試題,題庫,初中,高中,大學四六

運動步數有氧達人2018-06-03

記錄運動步數,積累氧氣值。還可偷

每日養生app2018-06-03

每日養生,天天健康

體育訓練成績評定2018-06-03

通用課目體育訓練成績評定