How to get shared database url in heroku

∥☆過路亽.° 提交于 2020-01-01 10:13:40

问题


How to get SHARED_DATABASE_URL in heroku.. while am trying to migrate it is asking for SHARED_DATABASE_URL how can i get it.. ??

heroku pg:reset --db SHARED_DATABASE_URL

What should i add in the place of SHARED_DATABASE_URL?? am working in ruby on rails

could anyone help me on this.


回答1:


You can use command: heroku pg:info or just heroku pg to get information about your database. You will get something like this:

HEROKU_POSTGRESQL_GRAY_URL (DATABASE_URL)

Then run: heroku pg:reset HEROKU_POSTGRESQL_GRAY_URL

to reset database on heroku.




回答2:


The instruction below worked for me :

$ heroku pg:credentials YOUR_DATABASE_NAME

It returns the informations ( url, port, dbname, user, password ) :

Connection info string:

"dbname=xxxxxxx host=dc2-103-73-245-224.shhdtdr-1.amazonaws.com port=6212 user=user31231 password=dyzjur sslmode=require"



来源:https://stackoverflow.com/questions/13347737/how-to-get-shared-database-url-in-heroku

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!