Rails 5 Sample Database Configuration for MySQL, SQLlite, Postgresql

rails
rubyonrails
database

(Varun Raj) #1

MySQL

development:
  adapter: mysql2
  encoding: utf8
  reconnect: false
  database: sample_sqlite3_development
  pool: 5
  username: root
  password:
  socket: /tmp/mysql.sock

test:
  adapter: mysql2
  encoding: utf8
  reconnect: false
  database: sample_sqlite3_test
  pool: 5
  username: root
  password:
  socket: /tmp/mysql.sock

production:
  adapter: mysql2
  encoding: utf8
  reconnect: false
  database: sample_sqlite3_production
  pool: 5
  username: root
  password:
  socket: /tmp/mysql.sock

PostgreSQL

development:
  adapter: postgresql
  encoding: unicode
  database: sample_postgres_development
  pool: 5
  username: sample_postgres
  password:

test:
  adapter: postgresql
  encoding: unicode
  database: sample_postgres_test
  pool: 5
  username: sample_postgres
  password:

production:
  adapter: postgresql
  encoding: unicode
  database: sample_postgres_production
  pool: 5
  username: sample_postgres
  password:

SQLite

development:
  adapter: sqlite3
  database: db/development.sqlite3
  pool: 5
  timeout: 5000

test:
  adapter: sqlite3
  database: db/test.sqlite3
  pool: 5
  timeout: 5000

production:
  adapter: sqlite3
  database: db/production.sqlite3
  pool: 5
  timeout: 5000