Mac上的PostgreSQL无法识别用户密码



我尝试了许多来自其他帖子的建议和SO问题,但似乎没有一个能奏效。我刚刚安装了带有brew-install的PostgreSQL,然后运行了initdb命令。输出显示该用户将用于DB,然而,该用户始终显示为mac用户。我可能缺少什么?

控制台输出:

createdb: could not connect to database template1: FATAL: password authentication failed for user "macuser" 
Users-MBP:~ macuser$ 

只需执行以下操作即可删除已安装的postgresql。

删除PostgreSQL的早期版本brew卸载-强制postgresql删除Postgres的所有文件rm-rf/usr/local/var/postgres

从Postgresql下载macOS软件包并安装。

https://www.postgresql.org/download/macosx/

默认用户将是postgres,安装时需要密码字段

最新更新