How To See MySQL Traffic Using tcpdump

Author: , March 22nd, 2016

Quick-and-dirty way: tcpdump -i eth0 -s 0 -l -X dst port 3306 NOTE: That option above is a dash-ELL which provides for unbuffered output. Maciej Dobrzanski posted the following script on the Percona site at https://www.percona.com/blog/2008/11/07/poor-mans-query-logging/, which I am reposting without permission because it is so good:

How To Create a Web Request Sniffer Using tcpdump and Perl

Author: , November 3rd, 2011

YMMV…

Additional Reading http://chaosreader.sourceforge.net/ http://www.id-snippet.com/3008/dump-http-packet-using-tcpdump-and-perl/ http://stein.cshl.org/~lstein/talks/WWW6/sniffer/ http://www.perlmonks.org/index.pl?node_id=254612