Postgres 11 默认密码(自制软件)

Jet*_*hro 7 postgresql

各种指南展示了如何使用 brew 在 mac 上安装/启动 postgres:

brew install postgresql
brew services start postgresql
Run Code Online (Sandbox Code Playgroud)

然而,通常的下一步,用空密码连接,失败了。

psql postgres
Password for user <>:
psql: fe_sendauth: no password supplied
Run Code Online (Sandbox Code Playgroud)

2019年如何在mac上连接新创建的postgres 11数据库?


前期研究:

看起来像默认密码用于为空。

官方的wiki指导,最近/相当近期的教程建议psql<databasename>应该只是工作,但这些失败,上述错误。

一个旧的引导较新的SO答案有你使用psql的,这给了同样的错误如上之前切换用户。

小智 1

    \n
  1. 在 shell 中以 \xe2\x80\x9eroot\xe2\x80\x9c 身份登录计算机

    \n
  2. \n
  3. 更改为 \xe2\x80\x9epostgres\xe2\x80\x9c 用户:

    \n
  4. \n
\n

$ su - postgres(不需要密码,因为您是root

\n
    \n
  1. 运行 psql
  2. \n
\n

$ psql

\n