1
$rails new twitter -d mysql

then the

database.yml

looks like

development:
  adapter: mysql2
  encoding: utf8
  reconnect: false
  database: twitter_development
  pool: 5
  username: root
  password: root
  host: localhost

So, i am sonfused why adapter is mysql2? not mysql? is this gonna be a problem? I need to change it back to mysql or leave it here? Thanks.

Ryan Bigg
  • 106,965
  • 23
  • 235
  • 261
Josh Morrison
  • 7,488
  • 25
  • 67
  • 86
  • @ghayes I am not sure. I afraid in other codes there are also mysql2. It will make it worse. – Josh Morrison Aug 14 '11 at 01:58
  • Well, is your server booting correctly? These are the only settings which specify the database server to connect to. You could possibly need other files / gems configured to properly connect to the database, but you can easily see this by trying to boot your server (or running `rake db:migrate` from the command prompt). – hayesgm Aug 14 '11 at 01:59
  • Okay, I found mysql2 here.http://rubygems.org/gems/mysql2 – Josh Morrison Aug 14 '11 at 02:02

2 Answers2

4

mysql2 is the modern successor of the mysql gem. Don't worry, this will work fine for all current MySQL versions.

More here: Ruby, Rails: mysql2 gem, does somebody use this gem? Is it stable?

Community
  • 1
  • 1
Patrick Glandien
  • 7,791
  • 5
  • 41
  • 47
2

The adapter is mysql2 as that is the gem you will be using to connect. There are two gems, mysql and mysql2. The correct gem to use for Rails 3 is mysql2.

Ryan Bigg
  • 106,965
  • 23
  • 235
  • 261