CakePHP Console under MAMP

So if you are running MAMP on your Mac and baking some CakePHP you may encounter errors when trying to run the Cake Console. The error is likely to look something like Warning Error: PDO::__construct(): [2002] No such file or directory (trying to connect via unix:///var/mysql/mysql.sock) in [/rootpath/lib/Cake/Model/Datasource/Database/Mysql.php, line 160] Add the following to your …