Upon installing PHPMyAdmin and MySQL 5 on my fresh Macbook I kept getting a socket error from PHPMyAdmin.
I found the solution googling around. Luckily others before me had the same problem.
The solution was to go into your PHP.INI file and edit these lines:
mysql.default_socket = /tmp/mysql.sock
mysqli.default_socket = /tmp/mysql.sock
It seems the default PHP installation doesn’t know where to find the thing on the Macbook.