当我创建一个新用户时,它无法登录数据库。
我这样做:
postgres@Aspire:/home/XXX$ createuser dev
Shall the new role be a superuser? (y/n) n
Shall the new role be allowed to create databases? (y/n) y
Shall the new role be allowed to create more new roles? (y/n) y
然后创建一个数据库:
postgres@Aspire:/home/XXX$ createdb -O dev test_development
之后,我尝试psql -U dev -W test_development
登录,但收到错误:
psql: FATAL: Peer authentication failed for user "dev"
我试图解决问题但失败了。