One can always edit their database.yml file to get the MySQL database connection, but there is an easier way.When creating your Ruby on Rails app with the command line

foo:rails_sites$ rails my_site

just change that command to the following:

foo:rails_sites$ rails -d mysql my_site

voila, Rails now uses MySQL as the default and your database.yml file is set accordingly with no pain! Woot!

Background info:

The new version of Ruby on Rails now uses SQLite as the default database.

It is still possible to use MySQL though and many apps and tutorials want one to do just that. Also, while SQLite ROCKS as a development environment, MySQL is much more suited to a production site.

Tags: ,