pt-kill user must have SUPER
PROCESS
permission.
The following command intends to kill queries which have execute time greater than 30s and save terminated queries to database.
pt-kill --host=localhost --user=pt_kill_user --password=pt_kill_pass \
--busy-time=30 --interval=5s \
--log-dsn=h=localhost,D=pt_kill,t=kill_log,P=3306,u=root,p=root \
--kill --daemonize --ignore-user=backup
or
pt-kill --busy-time 30 --kill --daemonize \
--user pt_kill_user --ask-pass --print \
--log-dsn "D=ws_mail,t=kill_log,h=10.140.0.4" \
--ignore-user "(backup|root)"