I had a similar problem once and it turned out to be a DNS issue. My DB server couldn't properly reverse map the name of the server with the websites on it and therefore it broke. The easy solution was to have MySQL not do the lookup on the website box.
I added a line in the my.cnf file that looks something like this...
skip-name-resolve
and it works ok now. I am not sure what the real answer is here, if anyone knows please let me know as the manual seems to lack info on how MySQL handles this.
Make sure the socket file exists though, could be simple as that.