2

我在开发中使用 sqlite3 构建了一个 rails 应用程序。现在我想使用 mysql2 部署到机架空间,我想知道我需要哪些更改。我不想将任何数据从开发环境转移到生产环境。我的 database.yml 文件如下所示:

# SQLite version 3.x
#   gem install sqlite3
#
#   Ensure the SQLite 3 gem is defined in your Gemfile
#   gem 'sqlite3'
development:
  adapter: sqlite3
  database: db/development.sqlite3
  pool: 5
  timeout: 5000

# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test:
  adapter: sqlite3
  database: db/test.sqlite3
  pool: 5
  timeout: 5000

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

你能告诉我我需要在这个文件中进行哪些更改以及我还需要做什么吗?

4

1 回答 1

1

你会希望你的生产数据库看起来像这样:

production:
  adapter: mysql2
  encoding: utf8
  database: name-of-your-mysql2-database-here
  pool: 5
  username: root
  password: your_password
于 2013-07-23T15:58:15.997 回答