mysql -e "SELECT CONCAT('KILL ',ID,';') FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'cphulkd' AND COMMAND = 'Query' AND TIME > 100 INTO OUTFILE '/var/lib/mysql-files/kill_list.txt';" && mysql -e "source /var/lib/mysql-files/kill_list.txt" && rm -rf /var/lib/mysql-files/kill_list.txt
mysql kill user
Leave a reply