Thanks for the great tip FurrTrap. It would’ve taken me a while to realise that too.
If you don’t want to edit php.ini.default, another option is to do the following in the terminal:
$ sudo mkdir /var/mysql
$ sudo ln -s /tmp/mysql.sock /var/mysql/
I gotta admit I think it’s a bit odd that the folks at MySQL don’t build the OSX version with the right socket. I figure everyone must have this problem.