簡體   English   中英

無法在 Mac 終端 ZSH 中打開 Postgres shell

[英]Unable to Open Postgres shell in Mac Terminal ZSH

免責聲明我都是 Mac 和 Postgres 的新手。 我最近購買了 2020 款 MacBook Pro,並一直在為我的個人 [學習] 開發計算機進行設置。 在嘗試安裝 Postgres 的過程中,我遇到了問題,並且不確定我做錯了什么/遺漏了什么。

我已經通過 Homebrew 安裝了 Postgres:

brew install postgresql

一切似乎都安裝得很好,但是每當我嘗試打開 Postgres shell 來輸入命令(來自 Windows/Bash 背景)時,我都會得到相同的響應:

>> psql
[1] ##### killed      psql
>> psql postgres
[1] ##### killed      psql postgres
>> psql -U postgres
[1] ##### killed      psql -U postgres

當詢問 psql 在哪里時:

>> where psql
/opt/homebrew/bin/psql

在嘗試確保啟動 postgresql 時,我按照 brew 安裝 output 中的說明運行:

>> pg_ctl -D /opt/homebrew/var/postgres start

pg_ctl: directory "/opt/homebrew/var/postgres" is not a database cluster directory

並且在嘗試檢查 Postgres 版本時:

>> postgres -V

[1] ##### killed postgres -V

我不確定我錯過了什么,任何幫助將不勝感激。 我正在嘗試設置 Postgres,以便我可以將它用於我試圖理解的 Angular 教程。 后端連接從來都不是我的強項,我正在努力解決這個問題。

我有同樣的問題。 現在有一個新版本的 Postgres 可以工作(穩定版 13.3)。 只需通過brew upgrade升級應用程序。

暫無
暫無

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

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