2017-04-12 8 views
1

私のHerokuデータベースをローカルホストにプルしようとすると、thisのドキュメントに従います。私は既に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を実行しようとするとHerokuデータベースをローカルにダウンロードしようとしています:データベースへの接続に失敗しました

はしかし、私は次のエラーを取得する:

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? 

誰も私がこの問題を解決する方法を見つけ出す手助けすることはできますか?

答えて

2

復元時にmydbデータベースを作成するには、--createオプションが必要です。それ以外の場合は、エラーメッセージに従って、存在しないように見えるmydbという名前の既存のdbを検索します。

関連する問題