簡體   English   中英

從 PGAdmin Container 連接本地 postgres 數據庫

[英]Connect local postgres database from PGAdmin Container

我正在嘗試從容器中的 PGadmin 連接到我的本地 postgres 數據庫,但它是通過以下錯誤:

Unable to connect to Server: connection to server at "localhost" (127.0.0.1), port 5432 failed. connection refused is the server running on that host and accepting TCP/IP connections?

我正在嘗試創建服務器的配置如下:

hostname/address = localhost
port = 5432
username = postgres

我的操作系統配置

OS = Linux- Ubuntu
Version = 18.04

PS:在 Stackoverflow 上有一些關於此的現有問題,但沒有解決方案對我有幫助。

雖然它在本地運行,但 docker 容器就像一台不同的機器。 你需要把本地主機的IP地址而不是localhost。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM