How to analyze SQL queries on a MySQL server with Percona Toolkit

June 11, 2014
1 min read

If you need to see what queries are performed by a MySQL database you can use New Relic service or use MySQL tools like Percona Toolkit. For general queries they’ll make a top of most used queries. 

1. First step is to activate general queries log with mysql command:


SET GLOBAL general_log = ‘ON; 

Attention: enable general queries log only for a couple of minutes, this can affect performance on a production server.

2. Process log with pt-query-digest from Percona Toolkit[1]. Command to generate a top of most used queries:


pt-query-digest --group-by distill --type genlog general.log  > general_group.log
Querydigest image

Share on:

Want to stay on top of everything?

Get updates on industry developments and the software solutions we can now create for a smooth digital transformation.

* I read and understood the ASSIST Software website's terms of use and privacy policy.

Frequently Asked Questions

ASSIST Software Team Members

See the past, present and future of tech through the eyes of an experienced Romanian custom software company. The ASSIST Insider newsletter highlights your path to digital transformation.

* I read and understood the ASSIST Software website's terms of use and privacy policy.

Follow us

© 2024 ASSIST Software. All rights reserved. Designed with love.