how to create database mysql

it is creating database.yml in sqlite format how can i create database in mydql

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.

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

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