CakePHP on OSX: Problem using Bake.php script
If you are getting the following errors while trying to bake something on osx 10.4:
"Warning: mysql_connect(): Can't connect to local MySQL server through
socket ‘/var/mysql/mysql.sock’ (2) in
/Library/WebServer/Documents/development/bakery/cake/libs/model/dbo/dbo_mysql.php
on line 117″
try doing the following:
sudo ln -s /tmp /var/mysql
Or you could follow the instruction given by Apple: Mac OS X Server 10.4: Issues connecting PHP to MySQL



Tried that, but it didn’t remove the issue for me
I’m using 1.2.0.5146alpha version with MAMP. CakePHP is able to connect to the database otherwise.
I have edited the /etc/my.cnf file as follows:
[mysqld]
socket=/Applications/MAMP/tmp/mysql/mysql.sock
That solved the baking issues with the stable version of cake. Can’t figure out what the problem is with 1.2. though…