I was trying to generate model code from cake command line tool. But got this issue.
Warning Error: PDO::__construct(): [2002] No such file or directory (try
Same problem here, but managed to resolve it connecting to IP:Port, not socket.
'host' => '127.0.0.1', //use 172.0.0.1 instead of localhost 'port' => '8889', //default MAMP MySQL devel port, default production port is 3306
and forget about socket connection.