安装 Postgres 后 psql 出错

问题描述 投票:0回答:1

使用 Homebrew 在 Mac OS X Sonoma 14.3.1 上安装 Postgres@16。

brew install postgresql@16

当我连接时:

psql -U postgres -h localhost

psql: error: connection to server at "localhost" (::1), port 5432 failed: FATAL:  auth_permission_dialog.dialog_executable_path is not a file
postgresql macos homebrew macos-sonoma
1个回答
0
投票

重新启动后,错误更改为:

psql: error: connection to server at "localhost" (::1), port 5432 failed: FATAL:  role "postgres" does not exist

我添加了一个用户:

createuser -s postgres

重新启动服务:

brew services restart postgresql@16 

现在一切都好:

psql -U postgres -h localhost
psql (16.2, server 16.1 (Homebrew))
Type "help" for help.

postgres=# 
© www.soinside.com 2019 - 2024. All rights reserved.