[英]Trying to Download Heroku Database to Local: Connection to Database Failed
我正在按照本文檔嘗試將Heroku數據庫拉到本地主機。 我已經成功運行了heroku pg:backups:capture
和heroku 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?
誰能幫我找出解決方法?
要在還原期間創建mydb
數據庫,您需要--create
選項。 否則,該命令將根據錯誤消息查找名為mydb
的現有數據庫,該數據庫似乎不存在。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.