使用 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
重新启动后,错误更改为:
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=#