当我创建一个新用户时,却无法登录数据库。
我这样做是这样的:
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"
我试图解决问题,但失败了。
--interactive
到命令中:createuser --interactive joe