当前位置:网站首页>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;
边栏推荐
- MySQL master-slave replication configuration construction, one step in place
- No, the Log4j vulnerability hasn't been fully fixed yet?
- @Bean 与 @Component 用在同一个类上,会怎样?
- What happens when @Bean and @Component are used on the same class?
- 和AI一起玩儿剧本杀:居然比我还入戏
- Camera coordinate system, world coordinate system, pixel coordinate system conversion, and Fov conversion of OPENGLDEFocal Length and Opengl
- Mobile phone side scroll to page to specify location
- debian problem
- Process and Scheduled Task Management
- STL source code analysis: conceptual understanding of iterators, and code testing.
猜你喜欢

五号黯区靶场 mysql 注入之limit注入记录

Electron之初出茅庐——搭建环境并运行第一个程序
![[硬核干货]由0到1,突破信息系统项目管理师(呕心沥血经验之谈)!!!](/img/9a/f3e4bdd0ce8ec153a8e6bdbff5647e.jpg)
[硬核干货]由0到1,突破信息系统项目管理师(呕心沥血经验之谈)!!!

The introduction of AI meta-learning into neuroscience, the medical effect is expected to improve accurately

Huawei released "ten inventions", including computing, intelligent driving and other new fields

2020年度总结——品曾经,明得失,展未来

What are the access modifiers, declaration modifiers, and keywords in C#?Literacy articles

万能js时间日期格式转换

The calculation proof of the intersection of the space line and the plane and its source code

Go 使用 freecache 缓存
随机推荐
Develop common tool software
The calculation of the determinant of the matrix and its source code
空间顶点到平面的距离计算的证明及其源码
Go 结合Gin导出Mysql数据到Excel表格
【雷达目标检测】恒定阈值法和恒虚警(CFAR)法及代码实现
Oracle查看表空间使用率及爆满解决方案
上传文件--文件类型大全,图片类型,文档类型,视频类型,压缩包类型
MySQL什么时候用表锁,什么时候用行锁?
interface
Electron之初出茅庐——搭建环境并运行第一个程序
When does MySQL use table locks and when does it use row locks?
The newcomer deleted data by mistake, and the team leader skillfully used MySQL master-slave replication to delay the recovery of losses
从 Google 离职,前Go 语言负责人跳槽小公司
ArrayList
Electron使用romote报错 : Uncaught TypeError: Cannot read property ‘BrowserWindow‘ of undefined
2020年度总结——品曾经,明得失,展未来
限塑令下的新材料——聚乳酸(PLA)
golang : Zap log integration
大飞机C919都用了哪些新材料?
The calculation proof of the intersection of the space line and the plane and its source code