Skip to content

Instantly share code, notes, and snippets.

@tomatolog
Forked from gstark/tcpdump.txt
Created March 13, 2018 12:17
Show Gist options
  • Save tomatolog/ae0f4ca5b887c6c57abc4b4316325b4c to your computer and use it in GitHub Desktop.
Save tomatolog/ae0f4ca5b887c6c57abc4b4316325b4c to your computer and use it in GitHub Desktop.
Use tcpdump to monitor mysql
Use tcpdump to monitor mysql
# Capture the packets
sudo tcpdump -i eth0 port 3306 -s 0 -x -n -q -tttt -w tcpdump.out
# analyze all the requests from a given host
pt-query-digest --type=tcpdump --filter '($event->{host} || $event->{ip} || "") =~ m/192.168.248.64/' tcpdump.out
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment