使用 Amazon RDS 时的 Rails database.yml 问题
当我使用 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
有关 Amazon RDS 插件的详细信息,请参阅 Heroku 文档 - 此处
see the Heroku docs for details of the Amazon RDS addon - here
在这里查看我解决此问题的演练: Heroku帮助部署使用Mysql数据库的Rails应用
View my walkthrough for solving this issue here: Heroku help deploying Rails app that uses Mysql database