簡體   English   中英

無法連接到運行在 windows 10 虛擬機中的 postgresql 服務器

[英]Cant connect to postgresql server running in windows 10 virtual machine

我在我的 pop-os 筆記本電腦上的 windows 10 虛擬機中運行一個 postgres 服務器。 我正在嘗試從我的主機操作系統 (linux) 連接到它。 在虛擬框中我創建了一個端口轉發規則:

在此處輸入圖像描述

我還將 postgres 配置中的偵聽端口更改為等於“*”。

我嘗試連接時收到的錯誤消息是:

postgres@pop-os:/home/peyton$ psql -p 5432
psql: error: could not connect to server: could not connect to server: No such file or directory
    Is the server running locally and accepting
    connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?

我不太了解這一點,所以我真的可以使用一些幫助。

謝謝。

問題是:

psql -p 5432

說連接到 Linux 機器上的本地套接字。 根據錯誤消息:

Is the server running locally and accepting
    connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?

您需要執行以下操作:

psql -p 5432 -h 127.0.0.1

暫無
暫無

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

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