#!/bin/bash
HOSTNAME="`ifconfig | awk -F'addr:|Bcast' '/Bcast/{print $2}'`"   #数据库信息
port=$1
USERNAME="qa"
PASSWORD="qatest"

for i in `/home/quant_group/mysql-5.6.31/bin/mysql -u${USERNAME} -p${PASSWORD} -P$port -se "show processlist" | grep -v "show processlist" | grep -v "$HOSTNAME" | awk '{if($4=="mall_settlement" )print $1}'`
do 
    mysql -u${USERNAME} -p${PASSWORD} -e "kill $i"

done

echo "done!!"
