Establish external database connection in production on Heroku

前端 未结 1 1496
遥遥无期
遥遥无期 2021-01-28 06:22

I am trying to establish a connection to a secondary, external database on Heroku (this is a PostgreSQL db running on AWS). I am trying to find the easiest and/or best way to do

1条回答
  •  死守一世寂寞
    2021-01-28 06:58

    You could change the database_url of the heroku config in the format shown below:

    postgres://:@:/
    

    For example:

    heroku config:set DATABASE_URL=postgres://myusername:mypassword@111.111.111.11:5542/myproject_production
    

    Just make sure the firewall allows the external connection to RDS.

    0 讨论(0)
提交回复
热议问题