Want to be debug all the raw MySQL statements sent to your MySQL box?
Just use wireshark.
In fact… here’s the magical command you need to run:
apt-get install apt-get install tshark
… now the command line version of wireshark is installed.
Now you can just start dumping the SQL commands running against your sever:
tshark -i 1 -T text -V -f ‘dst port 3306′ |grep -i ’statement: ‘
| cut -b20-
This will then dump all the SQL running against your server. For example:
SELECT COUNT( * ) FROM FOO WHERE FOO.ID = 'k~OVOe8XfxM' SHOW COLLATION SET autocommit=1 SHOW SLAVE STATUS /* lbpool */ SHOW PROCESSLIST /* lbpool */ SHOW SLAVE STATUS /* lbpool */ SHOW PROCESSLIST /* lbpool */ SELECT COUNT( * ) FROM FOO WHERE FOO.ID = 'dpm516E79n0' SELECT COUNT( * ) …[Read more]