WireShark (formerly Ethereal) will work perfectly, if you re not familiar with it, it can be a little tricky on OSX, Windows it s no problem and Linux can be a headache. You can download it here http://www.wireshark.org/, and read a short-primer here - http://www.ipprimer.com/packets.cfm
Essentially there s a capture
phase, and then you can work with the data – for your purposes you can live-capture and filter the output to the packets on the port/destination you care about, I ve used it many-a-time to debug dodgy home networking, or problems at the office.
Beware if using MySQL and localhost
for example, this is a key-word for MySQL and it will infact use the socket instead.. which makes things a matter more complicated, you can circumvent this problem by always making sure to use 127.0.0.1
if working with MySQL. (Perhaps other software uses this convention?)