Bake Script Problems in cakephp 1.2

Everyone who has a Mac knows that the bakescript and the required database connection doesn’t work after installation. Let me show you how it works:
First open the commandline and go to:

cd /htdocs/project/cake/console/

Then start the bake script with:

./cake bake

you’ll probably get the following msg’s:

Warning: mysql_pconnect(): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) in ...
Warning: mysql_select_db(): supplied argument is not a valid MySQL-Link resource in ...
Warning: mysql_get_server_info(): supplied argument is not a valid MySQL-Link resource in...
Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in ...

To resolve this problem go to your /etc folder and copy your php.ini.default to php.ini

sudo cp /etc/php.ini.default php.ini

Then open your new php.ini file with the vi editor

sudo vi /etc/

and change the following line:

mysql.default_socket = 
to
mysql.default_socket = /tmp/mysql.sock

And now please close you MAMP Application and check if all http processes are closed (use Activities Application)

And know enjoy baking!!

Leave a Reply