#!/bin/bash
passwd=“"
for id in `mysql -uxsjwslm_js -p$passwd -e "show processlist"|awk ‘/Sleep/{print $1}‘`
do
mysql -uxsjwslm_js -p$passwd -e "kill $id"
echo `date +"%F %T"` "kill $id" >> ar/log/mysql_kill_sleep.log
done
原文地址:https://www.cnblogs.com/zhangfu/p/10364616.html
时间: 2024-10-12 20:01:50