Baking with MAMP
Monday, April 21st, 2008
Recently I’ve been using CakePHP’s Bake tool to create quick MVC skeletons based on a predefined database structure. While the Bake itself is quite buggy and leaves a lot to be desired, it’s still definitely pretty amazing for (at the very least) creating Models and the associations they have with other models.
Because you can set MAMP to use specific ports, you may have to let your system know where MySQL is (Bake will throw that ugly where the heck is mysql.sock error). This is the same issue I’ve had when I’ve done custom MySQL installs on Mac and one of the reasons I love MAMP so. Quite simply, you just create a symbolic link (ln) from where Bake is “looking” for it to where MAMP is. Here’s what I ended up running in the terminal:
ln -s /Applications/MAMP/tmp/mysql/mysql.sock /var/mysql/mysql.sock
You might also have to create the /var/mysql directory to link them if this doesn’t work. Then navigate to where your cake installation is and inside of that head to /cake/scripts/ and:
php bake.phpRead the rest of this entry »