当我创建一个新用户,但它不能登录数据库。
我这样做:
原文链接:https://www.f2er.com/postgresql/193892.html我这样做:
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"
我试图解决问题,但失败。