Postgres无法识别创建的用户

问题描述

我刚刚在Ubuntu 18.04上安装了Postgresql 10。我有postres认的用户设置和密码。

我创建了一些用户数据库,但出现此错误。我该如何通过?

:~$ sudo -i -u myUser01
sudo: unkNown user: myUser01
sudo: unable to initialize policy plugin

我确认它们存在:

                                      List of roles
    Role name    |                         Attributes                         | Member of 
-----------------+------------------------------------------------------------+-----------
 myUser01        | Superuser,Create role,Create DB                          | {}
 myUser02        | Superuser,Create DB                          | {}
 postgres        | Superuser,Create DB,Replication,Bypass RLS | {}



                                 List of databases
      Name       |  Owner   | Encoding | Collate |  Ctype  |   Access privileges   
-----------------+----------+----------+---------+---------+-----------------------
 myUser01        | postgres | UTF8     | C.UTF-8 | C.UTF-8 | 
 myUser02        | postgres | UTF8     | C.UTF-8 | C.UTF-8 | 
 postgres        | postgres | UTF8     | C.UTF-8 | C.UTF-8 | 
 template0       | postgres | UTF8     | C.UTF-8 | C.UTF-8 | =c/postgres          +
                 |          |          |         |         | postgres=CTc/postgres
 template1       | postgres | UTF8     | C.UTF-8 | C.UTF-8 | =c/postgres          +
                 |          |          |         |         | postgres=CTc/postgres

这是我的etc / postgresql / 10 / main / pg_hba.conf。请注意,如果这很重要,我将数据库管理员设置为md5,而不是peer

# Database administrative login by Unix domain socket
local   all             postgres                                md5

# TYPE  DATABASE        USER            ADDRESS                 METHOD

# "local" is for Unix domain socket connections only
local   all             all                                     peer
# IPv4 local connections:
host    all             all             127.0.0.1/32            md5
# IPv6 local connections:
host    all             all             ::1/128                 md5
# Allow replication connections from localhost,by a user with the
# replication privilege.
local   replication     all                                     peer
host    replication     all             127.0.0.1/32            md5
host    replication     all             ::1/128                 md5

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)