使用 Amazon RDS 时的 Rails database.yml 问题

发布于 2024-10-24 04:46:53 字数 1024 浏览 1 评论 0原文

当我使用 Heroku 和 Amazon RDS 时,我的 database.yml 生成应该是什么样子?

我的数据库.yml

# SQLite version 3.x
# gem install sqlite3-ruby (not necessary on OS X Leopard)
# gem 'mysql', '2.8.1'

    development:
      adapter: mysql
      database: konkurranceportalen
      encoding: utf8
      pool: 5
      username: root
      password: 
      socket: C:/xampp/mysql/bin/mysqld.sock
      host: 127.0.0.1

    # 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: mysql
      database: rails_t
      encoding: utf8
      pool: 5
      username: root
      password: 
      socket: C:/xampp/mysql/bin/mysqld.sock
      host: 127.0.0.1

    production:
      adapter: mysql
      database: rails_t
      encoding: utf8
      pool: 5
      username: root
      password: 
      socket: C:/xampp/mysql/bin/mysqld.sock
      host: 127.0.0.1

How should my database.yml production look like when I am using Heroku and Amazon RDS?

My database.yml

# SQLite version 3.x
# gem install sqlite3-ruby (not necessary on OS X Leopard)
# gem 'mysql', '2.8.1'

    development:
      adapter: mysql
      database: konkurranceportalen
      encoding: utf8
      pool: 5
      username: root
      password: 
      socket: C:/xampp/mysql/bin/mysqld.sock
      host: 127.0.0.1

    # 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: mysql
      database: rails_t
      encoding: utf8
      pool: 5
      username: root
      password: 
      socket: C:/xampp/mysql/bin/mysqld.sock
      host: 127.0.0.1

    production:
      adapter: mysql
      database: rails_t
      encoding: utf8
      pool: 5
      username: root
      password: 
      socket: C:/xampp/mysql/bin/mysqld.sock
      host: 127.0.0.1

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

少女的英雄梦 2024-10-31 04:46:53

有关 Amazon RDS 插件的详细信息,请参阅 Heroku 文档 - 此处

see the Heroku docs for details of the Amazon RDS addon - here

森末i 2024-10-31 04:46:53

在这里查看我解决此问题的演练: Heroku帮助部署使用Mysql数据库的Rails应用

View my walkthrough for solving this issue here: Heroku help deploying Rails app that uses Mysql database

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文