Hello kartik,
Mass killing operation saves time. Do it in MySql itself:
Run these commands
mysql> select concat('KILL ',id,';') from information_schema.processlist
where user='root' and time > 200 into outfile '/tmp/a.txt';
mysql> source /tmp/a.txt;
if you do not want to store in file, store in a variable
Just run in your command prompt
> out1=$(mysql -B test -uroot -proot --disable-column-names -e "select concat('KILL ',id,';') from information_schema.processlist where user='root' and time > 200;")
> out2= $(mysql -B test -uroot -proot --disable-column-names -e "$out1")
Hope this works!!
Thank You!!