Jeroen Moors

blog

Logging mysql queries without touching mysqld
Written on 22 May 2012

While hunting for performance issues, a view on all queries executed by mysql can be very useful.

If you’re on a production system, you probably don’t want to touch the mysqld configuration.

Therefor this little sniplet can be used to sniff the mysql traffic and filter out the useful query stuff.

If your mysql-connections are not arriving at eth0, you’ll have to change it on the first line near -i eth0 to the right interface.