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