There have been several other posts about this, but none of the answers seemed to work for me.
When I navigate to the CakePHP page on my local machine, there is one
If you're on Godaddy (or any other shared hosting for that matter), they may be limiting outgoing connections to ports 80 and 443 only.
Try adding the socket:
'unix_socket' => '/Applications/MAMP/tmp/mysql/mysql.sock',
What did it for me in the end was that I had created a table in my database, but there was no data in it.
In order for CakePHP to recognize the MySql connection, there has to be a table with data in it.
I have had this problem since upgrading to OSX Yosemite and inserting following line did the trick for me:
'unix_socket' => '/tmp/mysql.sock'
It's your model. Open that up and there must be the following line
public $useDbConfig = 'local';
This overwrites global config & set it back to local
On Mac, using MAMP as a development platform, for cake the correct solution is using Domingo Casarrubio solution.
Add the unix_socket
parameter to your database configurations.
'unix_socket' => '/Applications/MAMP/tmp/mysql/mysql.sock',