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 database.php config file.

About CDB 361 Articles
Self-Employed Software Developer, Spark, Property Management, Hobby Forestry, Ex-Teacher, Engineering - Wood, Metal, Electrics & Computers. Outdoors - Walk, Cycle, Kitesurf,

Be the first to comment

Leave a Reply

Your email address will not be published.


This site uses Akismet to reduce spam. Learn how your comment data is processed.