Heroku postgresql数据库名称 [英] Heroku postgresql database name
本文介绍了Heroku postgresql数据库名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
$ heroku config |这是我必须找到一个heroku数据库名称的命令。 grep POSTGRESQL
我得到的结果类似于:
HEROKU_POSTGRESQL_NAVY_URL:postgres:// wxjwilh:tKDSwUlfZ8Da@fr6-84-24-28-19.compute-1.amazonaws.com:52 / d14grmkt
这个输出的哪一部分是数据库名称,我可以使用命令:
$ heroku pg:重设< DATABASE>
我尝试使用整个网址,但收到了无效的参数错误。
假设有一个名为的数据库d6u5qhrlnbdfmp
。那么就不必输入
heroku pg:reset d6u5qhrlnbdfmp
相反,我们可以简单地键入
heroku pg:reset DATABASE_URL
样本输出
E:\git\stutzen> heroku pg:重置d6u5qhrlnbdfmp --app stutzen
!未知数据库:d6u5qhrlnbdfmp。有效选项包括:DATABASE_URL,HEROKU_
POSTGRESQL_CYAN_URL
E:\git\stutzen> heroku pg:重置DATABASE_URL --appstutzen
!警告:破坏性行为
!这个命令会影响应用程序:stutzen
!要继续,请输入stutzen或用--confirm stutzen重新运行此命令
> stutzen
重置HEROKU_POSTGRESQL_CYAN_URL(DATABASE_URL)...完成
This is the command I have to find the name of a heroku database:
$ heroku config | grep POSTGRESQL
I get a result similar to:
HEROKU_POSTGRESQL_NAVY_URL: postgres://wxjwilh:tKDSwUlfZ8Da@fr6-84-24-28-19.compute-1.amazonaws.com:52/d14grmkt
which part of this output is the database name I can use with the command:
$ heroku pg:reset <DATABASE>
I tried using the whole url but got an invalid argument error.
解决方案
hope everyone confuses with placeholder and constant.
Assume having a db with name d6u5qhrlnbdfmp. then it is NOT necessary to type
heroku pg:reset d6u5qhrlnbdfmp
Instead we can plainly type
heroku pg:reset DATABASE_URL
the sample output
E:\git\stutzen>heroku pg:reset d6u5qhrlnbdfmp --app stutzen
! Unknown database: d6u5qhrlnbdfmp. Valid options are: DATABASE_URL, HEROKU_
POSTGRESQL_CYAN_URL
E:\git\stutzen>heroku pg:reset DATABASE_URL --app stutzen
! WARNING: Destructive Action
! This command will affect the app: stutzen
! To proceed, type "stutzen" or re-run this command with --confirm stutzen
> stutzen
Resetting HEROKU_POSTGRESQL_CYAN_URL (DATABASE_URL)... done
这篇关于Heroku postgresql数据库名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文