我想使用托管在我自己的服务器上的
mysql数据库.
我已将DATABASE_URL和SHARED_DATABASE_URL配置变量更改为指向我的服务器,但它仍在尝试连接到heroku的amazonaws服务器.我该如何解决这个问题?
我已将DATABASE_URL和SHARED_DATABASE_URL配置变量更改为指向我的服务器,但它仍在尝试连接到heroku的amazonaws服务器.我该如何解决这个问题?
解决方法
根据
Heroku documentation,改变DATABASE_URL是正确的方法.
If you would like to have your rails application connect to a non-Heroku provided database,you can take advantage of this same mechanism. Simply set your DATABASE_URL config var to point to any cloud-accessible database,and Heroku will automatically create your database.yml file to point to your chosen server. The Amazon RDS Add-on does this for you automatically,though you can also use this same method to connect to non-RDS databases as well.
这是一个应该有效的例子:
heroku config:添加DATABASE_URL = MysqL:// user:password @ host / db
您可能需要通过进行更改并运行git push heroku master来重新部署