Linux 4 All

Best Linux tricks source

Here is a quick trick for using tcpdump to get all MySQL queries running on a server:

tcpdump -i $INTERFACE -s 0 -l -w - dst port 3306 | strings | perl -e '
while(<>) { chomp; next if /^[^ ]+[ ]*$/;
    if (defined $q) { print "$q\n"; }
  } else {
    $_ =~ s/^[ \t]+//; $q.=" $_";

I think I got this from Percona website

How to log client IP with Apache behind Load Balancer arrow-right
Next post

arrow-left How to calculate the total size of MySQL engines
Previous post

Leave a Reply

Your email address will not be published. Required fields are marked *