Ruby on rails 尝试将Heroku数据库下载到本地:连接到数据库失败
我在下面的文档中尝试将Heroku数据库拉到本地主机。我已经成功运行了Ruby on rails 尝试将Heroku数据库下载到本地:连接到数据库失败,ruby-on-rails,postgresql,heroku,Ruby On Rails,Postgresql,Heroku,我在下面的文档中尝试将Heroku数据库拉到本地主机。我已经成功运行了heroku pg:backups:capture和heroku pg:backups:download,并在我的文件结构中查看了一个最新的.dump文件 但是,当我尝试运行pg\U restore--verbose--clean--no acl--no owner--h localhost-U myuser-d mydb latest.dump时,我得到以下错误: pg_restore: connecting to data
heroku pg:backups:capture
和heroku pg:backups:download
,并在我的文件结构中查看了一个最新的.dump
文件
但是,当我尝试运行pg\U 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?
有人能帮我解决这个问题吗?要在恢复期间创建
mydb
数据库,您需要--create
选项。否则,根据错误消息,该命令将查找名为mydb
的现有数据库,该数据库似乎不存在