Ruby Forum Ruby on Rails > how to create database mysql

Posted by Manika Suri (mani)
on 01.05.2008 13:36
it is creating database.yml in sqlite format
how can i create database in mydql
Posted by Ar Chron (railsdog)
on 01.05.2008 15:07
Manika Suri wrote:
> it is creating database.yml in sqlite format
> how can i create database in mydql

rails appname -d mysql


or just alter your existing datbase.yml to reference the correct 
adapter:

development:
  adapter: mysql
  database: yourdb_dev
  username: username
  password: password
#  socket: /var/run/mysqld/mysqld.sock

socket is needed for Ubuntu, but not Windows in my experience. Can't 
speak for any other *nix-like OS's.
Posted by AndyV (Guest)
on 01.05.2008 16:12
(Received via mailing list)
And just to help a bit more, in Rails 2.x you can now:

rake db:create:all

That will take the definitions in database.yml and actually create the
db's
Posted by Roy Pardee (rpardee)
on 01.05.2008 17:19
(Received via mailing list)
When you create your app w/the 'rails' command use the -d (database)
option to specify the db to use.  So:

  rails my_cool_app -d mysql

HTH,

-Roy