tcpdump (1)


watch mysql queries as they happen

cunning bit of Perl, not to be used permanently, but very handy indeed for a quick look at what’s actually being queried… [code] tcpdump -i eth0 -s 0 -l -w – dst port 3306 | strings | perl -e ‘ while(<>) { chomp; next if /^[^ ]+[ ]*$/; if(/^(SELECT|UPDATE|DELETE|INSERT|SET|COMMIT|ROLLBACK|CREATE|DROP|ALTER)/i) { if (defined $q) { print […]