mysql l查看历史等锁信息_mysql查看锁等信息SQL
查看锁等信息,包括锁信息:select "HOLD:",ph.id h_processid,trh.trx_id h_trx_id,trh.trx_started h_started,trh.trx_state h_state,lsh.lock_table h_table,lsh.lock_index h_index,lsh.lock_mode as h_lock_mode,lsh.lock_ty
查看锁等信息,包括锁信息:
select "HOLD:",ph.id h_processid,trh.trx_id h_trx_id,trh.trx_started h_started,trh.trx_state h_state,lsh.lock_table h_table,lsh.lock_index h_index,lsh.lock_mode as h_lock_mode,lsh.lock_type h_lock_type,ph.user h_user,ph.host h_host,
ph.command p_command,ph.info p_info,"WAIT:",pw.id w_processid,trw.trx_id w_trx_id,trw.trx_started w_started,trw.trx_state w_state,lsw.lock_table w_table,lsw.lock_index w_index,lsw.lock_mode w_lock_mode,lsw.lock_type w_lock_type,pw.user w_user,pw.host w_host,
pw.command w_command,pw.info w_info from information_schema.INNODB_LOCK_WAITS lw inner join information_schema.INNODB_TRX trh on trh.trx_id=lw.blocking_trx_id inner join information_schema.PROCESSLIST ph on trh.trx_mysql_thread_id=ph.id left join information_schema.INNODB_LOCKS lsh on lsh.lock_trx_id=trh.trx_id inner join information_schema.INNODB_TRX trw on trw.trx_id=lw.requesting_trx_id inner join information_schema.PROCESSLIST pw on trw.trx_mysql_thread_id=pw.id left join information_schema.INNODB_LOCKS lsw on lsw.lock_trx_id=trw.trx_id ;
查找当前进程的执行状态:
SELECT a.trx_id, trx_state, trx_started, b.id AS thread_id, b.info, b.user, b.host, b.db,
b.command, b.state FROM information_schema.`INNODB_TRX` a, information_schema.`PROCESSLIST` b WHERE a.trx_mysql_thread_id = b.id ORDER BY a.trx_started;
魔乐社区(Modelers.cn) 是一个中立、公益的人工智能社区,提供人工智能工具、模型、数据的托管、展示与应用协同服务,为人工智能开发及爱好者搭建开放的学习交流平台。社区通过理事会方式运作,由全产业链共同建设、共同运营、共同享有,推动国产AI生态繁荣发展。
更多推荐



所有评论(0)