Tailing the MySQL query log in real time can be a lifesaver for any developer, and it’s pretty easy to do:
Make a file for the mysqld process to write to:
sudo touch /var/log/mysql-query.log sudo chown _mysql /var/log/mysql-query.log
If you’ve installed MySQL 5.1.x from the Mac .pkg, you won’t have an /etc/my.cnf, but it just needs to have these two lines:
[mysqld] log=/var/log/mysql-query.log
Restart MySQL by opening the MySQL preference pane, click stop, then start, then tail -f /var/log/mysql-query.log. It turns out that when the preference pane is open, it pings the database every 2 seconds, so it can detect if the db is alive. If you mangle the my.cnf, you’ll find the start button seems to not respond to clicks.
(I found this link only after I found out what I needed to do…)