Published by Jim Parshall on 01 Apr 2008 at 08:28 am
Ruby on Rails 2.0 and MySQL Databases
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: MySQL, Ruby on Rails