我在使用pg:pull时使用密码字段时遇到问题。使用我的Heroku postgres数据库

时间:2017-01-27 21:53:39

标签: ruby-on-rails postgresql heroku

我正在使用Cloud9 IDE操作系统ubuntu。我最近从我的Rails应用程序中卸载了我的本地SQLlite3数据库,并成功安装了本地postgres数据库。我现在正试图从Heroku中提取postgres生产数据库。

如果我在Rails控制台中运行ActiveRecord::Base.connection.instance_variable_get(:@config)

  

{:adapter =>“postgresql”,:encoding =>“unicode”,:pool => 5,:template =>“template0”,:username =>“ubuntu”,:password = >“password”,:database =>“learning_app_development”}

从命令行按these说明操作:

$ heroku pg:pull DATABASE_URL mylocaldb --app my-app-6503
  

heroku-cli:拉postgresql-meadows-7463 ---> mylocaldb
  密码:

在此字段中输入密码后,它将失败:

  

createdb:无法连接到数据库template1:​​FATAL:用户“ubuntu”的密码验证失败

This answer by Elliot是我在本地设置postgres时所遵循的说明。

1 个答案:

答案 0 :(得分:0)

我用这个答案解决了这个问题:

heroku pg:pull password authentication failed

来自乔尔。

除了Heroku不接受密码作为密码之外,对我来说没有任何意义吗?