【问题标题】:Trying to Download Heroku Database to Local: Connection to Database Failed尝试将 Heroku 数据库下载到本地:连接到数据库失败
【发布时间】:2017-04-12 18:58:26
【问题描述】:

我正在关注this 文档以尝试将我的 Heroku 数据库拉到我的本地主机。我已经成功运行了heroku pg:backups:captureheroku pg:backups:download,并在我的文件结构中看到了latest.dump 文件。

但是,当我尝试运行 pg_restore --verbose --clean --no-acl --no-owner -h localhost -U myuser -d mydb latest.dump 时,出现以下错误:

pg_restore: connecting to database for restore
pg_restore: [archiver (db)] connection to database "mydb" failed: could not connect to server: Connection refused
Is the server running on host "localhost" (::1) and accepting TCP/IP connections on port 5432?  could not connect to server: Connection refused      
Is the server running on host "localhost" (127.0.0.1) and accepting TCP/IP connections on port 5432?

谁能帮我弄清楚如何解决这个问题?

【问题讨论】:

    标签: ruby-on-rails postgresql heroku


    【解决方案1】:

    要在恢复期间创建mydb 数据库,您需要--create 选项。否则,该命令会根据错误消息查找名为 mydb 的现有数据库,但该数据库似乎不存在。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2015-10-23
      • 2021-07-14
      • 2013-07-04
      • 2019-03-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多