如何看mysql锁信息

正在等待所有锁的信息:
select * from innodb_lock_waits;

阻塞事物的列表:
admin@172.17.0.81 15:15:  [information_schema]>select * from innodb_locks where lock_trx_id in (select blocking_trx_id from innodb_lock_waits);
或者
admin@172.17.0.81 15:18:  [information_schema]>select * from innodb_locks join innodb_lock_waits on (innodb_locks.lock_trx_id=innodb_lock_waits.blocking_trx_id);

特定表上的锁列表:
admin@172.17.0.81 15:20:  [information_schema]>select * from innodb_locks where lock_table='table_name';

等待锁的事物列表:
admin@172.17.0.81 15:39:  [information_schema]>select trx_id,trx_requested_lock_id,trx_mysql_thread_id,trx_query from innodb_trx where trx_state='LOCK_WAIT';
上一篇:子网掩码与prefixLength长度的互相转换


下一篇:innobackupex 出现Unrecognized character \x01; marked by <-- HERE after <-- HERE near column 1 at - line 1374.