繁体   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