檢視Mysql鎖情況

2021-09-01 13:33:23 字數 684 閱讀 3751

#當前執行的所有事務

select * from information_schema.innodb_trx;

#當前出現的鎖

select * from information_schema.innodb_locks;

#鎖等待的對應關係

select * from information_schema.innodb_lock_waits

# 檢視下autocommit的值

select @@autocommit;

1813

# 檢視資料庫的隔離級別:

select @@tx_isolation;

# 檢視先當前庫的執行緒情況:

show full processlist;

# kill 程序

kill 1825;

# 檢視表是什麼時候更新的

select * from information_schema.tables where table_schema='test1' and table_name='rpt_test' ;

#整個資料庫備份

mysqldump -u root -p --databases wxss > c:\users\administrator\desktop\sql\wxss_database.sql

mysql檢視鎖表情況

mysql show status like table variable name value table locks immediate 105 table locks waited 3 table locks immediate 指的是能夠立即獲得表級鎖的次數 table locks wait...

mysql 檢視鎖表日誌 MYSQL 表鎖情況檢視

檢視鎖表情況 mysql show status like table variable name value table locks immediate 795505 table locks waited 0 table open cache hits 0 table open cache mis...

mysql 檢視表鎖死情況並解決

mysql檢視被鎖住的表 查詢是否鎖表 show open tables where in use 0 檢視所有程序 mysql show processlist mariabd show full processlist 查詢到相對應的程序 然後 kill id 殺掉指定mysql連線的程序號 k...