Ruby on Rails 3 with MySQL

Ever asked how to set up Rails to work with a mysql-instance installed via homebrew? Here is how.

After installing Homebrew, Git and MySQL, add the MySQL Gem via gem install mysql2.

Now you should be able to create new rails apps set up to work with your mysql-instance via rails new yourappname -d mysql or edit your database.yml according to this:

development:
  adapter: mysql2
  encoding: utf8
  reconnect: false
  database: yourappname_development
  pool: 5
  username: root
  password:
  socket: /tmp/mysql.sock

...

 

Add your comment

Please keep it polite and on topic. Your email address will not be published.

This is a captcha-picture. It is used to prevent mass-access by robots. (see: www.captcha.net)