mysql问题排查常用脚本

翎野君 / 2024-10-23 / 原文

1.查询不是sleep或者有状态的sql

select * from information_schema.`PROCESSLIST` where command != 'SLEEP'

2.查询运行中的事务

select trx_state, trx_started, trx_mysql_thread_id, trx_query from information_schema.innodb_trx

3.查看进程

show full processlist

  

本篇文章如有帮助到您,请给「翎野君」点个赞,感谢您的支持。