天天看點

Mysql查詢正在執行的語句

1、 查詢正在執行的語句

show open tables where in_use >0;
           

2、檢視所有程序

show processlist;
           

3、殺掉正在執行的mysql連接配接的程序

kill 查詢到的id
           

4、查詢正在鎖的事務

select * from information_schema.innodb_locks;
           

5、查詢等待鎖的事務

select * from information_schema.innodb_locks_waits;