If you have a mac and have upgraded to the latest operating system 10.10, you may find that mysql is not able to connect.
The fix is pretty easy, its an update to the php.ini
What we need to do is tell mysql to connect through localhost instead of 127.0.0.1
First locate the php.ini you can use the following command in terminal
locate php.ini
Look for something like /private/etc/php.ini
This is an example of what may come back
/Users/engine23/php.ini
/private/etc/php.ini-5.2-previous
/private/etc/php.ini.default
/private/etc/php.ini.default-5.2-previous
You may have may of them and if you dont have one called /private/etc/php.ini it may be named /private/etc/php.ini.default, if so copy that and rename it to just php.ini.
sudo cp /private/etc/php.ini.default /private/etc/php.ini
Now you know what file to edit, using terminal edit that file
sudo vim /private/etc/php.ini