I was experiencing following error in my mac after i upgraded to Yosemite.
Shammis-MacBook-Pro:~ shammi$ mysql
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
Then i went through so many ways to get rid of the issue. Finally this advise made it working. I found that from here.