I’m having problems to connect pt-kill when I need to run the command on localhost but log the killed processes on a remote server. The user running pt-kill has all necissary permissions and uses a ~/.my.cnf for it’s credentials. The command I run is:
perl pt-kill --host=localhost --busy-time 10 --interval=10s --wait-before-kill=5s --wait-after-kill=5s --victims oldest --nostrip-comments --any-busy-time=10s --log-dsn=h=172.30.16.40,D=percona,t=kill_log,P=3306,u=ptuser,p=PASSWORD --kill --daemonize
So what I expect is that pt-kill will use the .my.cnf credentials to connect to localhost and then use the --log-dsn for logging killed queries. But it tries to connect to the remote server as root and not ptuser:
DBI connect(‘;host=DBI:mysql: percona;host=172.30.16.40;port=3306;mysql_read_default_group=client;mysql_read_default_group=client’,‘root’,…) failed: Access denied for user ‘root’@‘172.30.40.49’ (using password: YES) at pt-kill line 1763
If I instead use a table on localhost for logging the killed queries it works fine:
perl pt-kill --busy-time 10 --host localhost --interval=10s --wait-before-kill=5s --wait-after-kill=5s --victims oldest --nostrip-comments --any-busy-time=10s --log-dsn=h=localhost,D=percona,t=kill_log,P=3306,u=ptuser,p=PASSWORD --kill --daemonize
What am I doing wrong? Or is it not possible to achieve this. It would be a lot easier if all pt-kill logged to a central table on a remote server.
Brgds