Mysql on a fresh snow leopard install

Simply, what’s the best way for me to put mysql on a fresh snow leopard
install?

Do I need xcode installed first?

Thanks.

bb

bingo bob wrote:

Simply, what’s the best way for me to put mysql on a fresh snow leopard
install?

Do I need xcode installed first?

Yes! You should install Xcode so that you’ll have all the developer
tools that you will need. Xcode will include Ruby, Rails, gcc (for
compiling C extensions), etc.

  1. Install Xcode.
  2. Update RubyGems
    sudo gem update --system
  3. Update any outdated gems
    gem outdated
    sudo gem install
  4. Create a new Rails project using MySQL
    rails my_proj --database mysql
  5. Open my_proj/config/database.yml
  6. Install the mysql gem using the instructions at the top of
    database.yml.
  7. Install the correct MySQL package for your specific platform
    http://dev.mysql.com/downloads/mysql/5.1.html#macosx-dmg
  8. Make sure mysql is started and working
    $ mysql -u root
  9. Make sure the mysql gem is working as expected.
    my_proj$ rake db:create
    my_proj$ ./script/dbconsole

That should take care of everything to get you up and running with Rails
and MySQL.

This is bloomin fantastic. Thanks.

However if I’ve got it points 6 and 7 need to be reversed?

Is that right?

cheers

bb.

bingo bob wrote:

This is bloomin fantastic. Thanks.

However if I’ve got it points 6 and 7 need to be reversed?

Not necessarily. I don’t believe you actually have to install MySQL
before installing the mysql gem, but I could possibly be wrong about
that. In any case it shouldn’t hurt to switch those two steps.

Robert W. wrote:

bingo bob wrote:

This is bloomin fantastic. Thanks.

However if I’ve got it points 6 and 7 need to be reversed?

Not necessarily. I don’t believe you actually have to install MySQL
before installing the mysql gem, but I could possibly be wrong about
that.

You would at least need libmysql-dev, no?

In any case it shouldn’t hurt to switch those two steps.

Best,
–Â
Marnen Laibow-Koser
http://www.marnen.org
[email protected]

Marnen Laibow-Koser wrote:

You would at least need libmysql-dev, no?

Good point. Thanks for clarification. The OP was right I did get those
reversed. It’s not like I scrutinized that process when I wrote that,
but was hoping the reader got the general idea.

It was REALLY useful to show all the steps and got my new Mac up to
speed with rails and everything uber quick. Thanks very much, I’ll be
bookmarking this post. bb.