rails/mysql makeup post

remember a few days ago when i was complaining about my difficulties getting rails set up and running?  well, here’s how it all turned out.

the error i was getting (”Can’t connect to local MySQL server through socket ‘/tmp/mysql.sock”) was caused by two things:

  1. i forgot to start the mysql server before trying rake, and
  2. i didn’t edit .bash_profile correctly.

the first thing to fix was pretty obvious- start the mysql server from within system preferences.

after doing that, i got the inspiring “rake aborted!  Unknown database ‘demo_development’” error.  as i was going step by step through one of my many sets of installation instructions (this time browsing through Beginning Rails), i realized i didn’t have a .bash_profile file and that i may not have actually created a database.  i thought i remember adding it when first setting up this project, but it wasn’t there.  this was fixed by creating the file and adding the line “export PATH=”/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:$PATH” ” and then creating a database with “mysqladmin -uroot create demo_development”.

crossed my fingers, gave rake one last go, and all is now well.

ps.  yes, this post is partially a reference for if when i screw this up again.