时间:2021-07-01 10:21:17 帮助过:16人阅读
关闭指定ip的连接:
for i in $(mysql -uusername -ppassword -Bse "select * from information_schema.processlist where HOST like ‘ip_addr%‘" | awk ‘{print $1}‘);do mysql -uusername -ppassword -e "kill $i";done
下文摘自:mysql 清除连接
清除所有连接
for i in $(MySQL -h192.168.10.101 -uwebuser -pwebuser@123 -Bse "show processlist" | awk ‘{print $1}‘);do mysql -h192.168.10.101 -uwebuser -pwebuser@123 -e "kill $i";done
清除admin的所有连接
for i in $(mysql -h192.168.10.101 -uwebuser -pwebuser@123 -Bse "show processlist" | awk ‘{if($2=="admin")print $1}‘);do mysql -h192.168.10.101 -uwebuser -pwebuser@123 -e "kill $i";done
mysql清理连接
标签:blank lis 清除 ssl form nbsp bsp http detail