Hello, I used Maatkit before it became Percona Toolkit and could regularly run this:
mk-query-digest --processlist h=host,D=db,u=uname,p=pwd --print --interval 0.5 > /tmp/process_qry.log
When I try to run pt-query-digest the same way I get a message that --print is no longer valid. When I run it without --print just says “Reading from STDIN …” and never actually records anything.
$>pt-query-digest --processlist h=host,D=db,u=uname,p=pwd --interval 0.5 > /tmp/process_qry.log
Wait 10 minutes, then
$>cat /tmp/process_qry.log
Reading from STDIN …
What am I doing wrong?
Thanks,
Ken
Hi,
I’ve tested pt-query-digest and I wasn’t able to reproduce the problem.
I ran
bin/pt-query-digest --processlist h=localhost --interval=0.01 --output slowlog
Then I ran some queries on that MySQL instance and I am was able to get an output:
Reading from STDIN ...
# Time: 2017-02-21T16:31:31
# User@Host: root[root] @ localhost []
# Query_time: 0.020595 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 0
use db_facturacion;
select * from clientes;
Could you run it enabling the debug mode?
Example:
It will produce a HUGE amount of data so be careful, don't redirect the output, just check is there is any major error being reported.
Also, could you specify the toolkit version you are using? You can get the version using:
pt-query-digest --version
Regards
Thanks for the reply.
[~]$ pt-query-digest --version
pt-query-digest 2.2.20
I just tested byadding “–output slowlog” and now it works!
Thanks very much!!!
I had this problem.
pt-query-digest --processlist h=127.0.0.1,u=root --ask-pass
pt-query-digest --processlist h=127.0.0.1,u=root --output /home/pt-query-digest.log --ask-pass --daemonize
no output, nor log file generated.
[root@server home]# pt-query-digest --version
pt-query-digest 3.5.4
Hello @wan_fujinan welcome to percona community!!!
The --output parameter is used to specify the output type, not location.
You need to set the --output as slowlog and --log option to send the output to a file