O'Reilly logo

MySQL 8 Cookbook by Karthik Appigatla

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

TCP dump

You can capture TCP traffic using the tcpdump command and send it to pt-query-digest for analysis:

shell> sudo tcpdump -s 65535 -x -nn -q -tttt -i any -c 1000 port 3306 > mysql.tcp.txtshell> pt-query-digest --type tcpdump mysql.tcp.txt > tcpdump_digest

There are plenty of options available in pt-query-digest, such as filtering queries for a specific time window, filtering a specific query, and generating reports. Please refer to the Percona documentation at https://www.percona.com/doc/percona-toolkit/LATEST/pt-query-digest.html for more details.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required