what did you enter for the MySQL Server name in the connection file? Try using the local loop back address:
127.0.0.1
instead of localhost.
if that does not solve the problem, see this page for details:
solve-cant-connect-to-local-mysql-server-through-socket-tmpmysqlsock/
In some cases, I have had people report that the only way to fix the issue was to re install MAMP