当前位置:网站首页>MYSQL 主从恢复锁表后, 处理SQL 线程锁解决.
MYSQL 主从恢复锁表后, 处理SQL 线程锁解决.
2022-07-30 05:55:00 【网络笨猪】
1. 按客户端 IP 分组,看哪个客户端的链接数最多
select client_ip,count(client_ip) as client_num from (select substring_index(host,':' ,1) as client_ip from information_schema.processlist ) as connect_info group by client_ip order by client_num desc;
2. 查看正在执行的线程,并按 Time 倒排序,看看有没有执行时间特别长的线程
select * from information_schema.processlist where Command != 'Sleep' order by Time desc;
3. 查询当前运行的所有事物:
select * from information_schema.innodb_trx \G
4. 清理掉所有状态不是Sleep且等待时间待遇5分钟的sql进程, 一般都是Query: “Waiting for global read lock”
select concat('kill ', id, ';') from information_schema.processlist where Command != 'Sleep' and Time > 300 order by Time desc;
边栏推荐
- 2020 ACM | MoFlow: An Invertible Flow Model for Generating Molecular Graphs
- What are the access modifiers, declaration modifiers, and keywords in C#?Literacy articles
- 图解关系数据库设计思想,这也太形象了
- 阿里二面:Redis有几种集群方案?我答了4种
- 让百度地图生成器里的“标注”内容展开--解决方案
- this与super
- Redis download and installation
- 雷总个人博客看到
- [硬核干货]由0到1,突破信息系统项目管理师(呕心沥血经验之谈)!!!
- 你被MySQL 中的反斜杠 \\坑过吗?
猜你喜欢

C#的访问修饰符,声明修饰符,关键字有哪些?扫盲篇

mysql高阶语句(一)

New material under the plastic restriction order - polylactic acid (PLA)

2020 ACM | MoFlow: An Invertible Flow Model for Generating Molecular Graphs

Go 结合Gin导出Mysql数据到Excel表格

大飞机C919都用了哪些新材料?

STL源码剖析:迭代器的概念理解,以及代码测试。

export , export default,import完整用法

【MySQL】MySQL中如何实现分页操作

Pioneer in Distributed Systems - Leslie Lambert
随机推荐
阿里二面:Sentinel vs Hystrix 对比,如何选择?
STL源码剖析:bound friend template friend代码测试和理解
舒尔补(schur completement)
阿里二面:Redis有几种集群方案?我答了4种
go : go gin返回JSON数据
Keil软件中map文件解析
The first artificial intelligence safety competition officially launched
Redis download and installation
Ali: How many methods are there for multi-threaded sequential operation?
2020年度总结——品曾经,明得失,展未来
STL源码剖析:迭代器的概念理解,以及代码测试。
STL源码剖析:临时对象的代码测试和理解
The newcomer deleted data by mistake, and the team leader skillfully used MySQL master-slave replication to delay the recovery of losses
AI can identify race from X-rays, but no one knows why
Huawei released "ten inventions", including computing, intelligent driving and other new fields
No, the Log4j vulnerability hasn't been fully fixed yet?
golang : Zap日志整合
Calculate the inverse source of the matrix (using the adjoint matrix, a 3x3 matrix)
MySQL master-slave replication configuration construction, one step in place
Distance calculation from space vertex to straight line and its source code