Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save rhodee/3163668 to your computer and use it in GitHub Desktop.
Save rhodee/3163668 to your computer and use it in GitHub Desktop.
Rails 3 database.yml examples
# MySQL. Versions 4.1 and 5.0 are recommended.
#
# Install the MySQL driver:
# gem install mysql2
#
# And be sure to use new-style password hashing:
# http://dev.mysql.com/doc/refman/5.0/en/old-client.html
defaults: &defaults
adapter: mysql2 #or mysql
encoding: utf8
reconnect: false
pool: 5
socket: /tmp/mysql.sock
username: root
password: root
development:
<<: *defaults
database: test-mysql2_development
test:
<<: *defaults
database: mysql2_test
production:
<<: *defaults
database: test-mysql2_production
# PostgreSQL. Versions 7.4 and 8.x are supported.
#
# Install the pg driver:
# gem install pg
# On Mac OS X with macports:
# gem install pg -- --with-pg-config=/opt/local/lib/postgresql84/bin/pg_config
defaults: &defaults
adapter: postgresql
encoding: unicode
pool: 5
username: uname (or your username if PostgreSQL installed by Homebrew)
password:
development:
<<: *defaults
database: postgres_development
test: &test
<<: *defaults
database: postgres_test
production:
<<: *defaults
database: postgres_production
cucumber:
<<: *test
# gem install sqlite3
defaults: &defaults
adapter: sqlite3
pool: 5
timeout: 5000
development:
<<: *defaults
database: db/development.sqlite3
test: &test
<<: *defaults
database: db/test.sqlite3
production:
<<: *defaults
database: db/production.sqlite3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment