I wish to create my Rails application with MySQL, because I love it a lot. How do i do this within the latest version of Rails?

Normally, you'd produce a new Rails application using

rails ProjectName

To make use of MySQL, use

rails -d mysql ProjectName

If you have a rails project, alter the adapter within the config/database.yml file to mysql and make certain you specify a legitimate password, and optionally, a socket:

  adapter: mysql
  database: db_title_dev
  username: koploper
  host: localhost
  socket: /tmp/mysql.sock

for rails 3 use $rails new projectname -d mysql

rails -d mysql ProjectName

If you're developing a new rails application you are able to set the database while using -d switch such as this:

rails -d mysql myapp

It's usually simple to switch your database later though, and taking advantage of sqlite is really simpler if you're developing on the Mac.

If you work with rails 3 or greater version

rails new -d mysql your_project_title

for those who have earlier version

rails new -d mysql your_project_title

So before you decide to make your project you have to discover the rails version. that you could find by

rails -v

I installed rails 2. a few days ago during my ubuntu server also it chose mysql as default.

giancarlo -- don't forget this Q&A whenever you upgrade from Rails 2. to Rails 2..2 -- which was the version where SQLite grew to become the default database for any new application rather than MySQL.

Plus, without having a compelling reason to make use of version 5., I'd suggested version 5.1. It has been out since June, is stable, not to mention has nice additional features. Time zone support and named scopes are my faves.

para usar o mysql por padrao o "d" é em maiusculo rails -D mysql 'project_name'

In Rails 3, you could do this

$rails new projectname --database=mysql

Rails wiki always beneficial for the initial layer configuration information.