MacOS PostgreSQL安装后createdb报错 password authentication failed for user "用户名"

 

在安装PostgreSQL后,createdb命令报错 password authentication failed for user "用户名"。

经过查证,可能是因为不存在用户导致的。

 

可以运行命令:

sudo su postgres -c 'createuser -P --superuser username'

具体按照提示操作即可。

参考:https://stackoverflow.com/questions/20692100/createdb-could-not-connect-to-database-template1-fatal-password-authenticatio

posted @ 2020-10-14 12:53  MythosMa_Web  阅读(1461)  评论(2)    收藏  举报