【发布时间】:2021-03-13 00:35:40
【问题描述】:
我在 dreamcompute(即云计算)上有一个 ubuntu 20。
我创建了一个用户和一个数据库。这是数据库和用户的列表(由于某种原因,我在matt 用户名下看不到数据库)。
我进入:
nano /etc/postgresql/13/main/postgresql.conf &
nano /etc/postgresql/13/main/pg_hba.conf 完成了整个'*' 和'0.0.0.0/0'
postgres=# \l
List of databases
Name | Owner | Encoding | Collate | Ctype | Access privileges
-----------+----------+----------+---------+---------+-----------------------
postgres | postgres | UTF8 | C.UTF-8 | C.UTF-8 |
strapi | postgres | UTF8 | C.UTF-8 | C.UTF-8 | =Tc/postgres +
| | | | | postgres=CTc/postgres+
| | | | | hossein=CTc/postgres
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
(4 rows)
如您所见,matt 用户名下的Superuser 和数据库strapi 是看不到的。
List of roles
Role name | Attributes | Member of
-----------+------------------------------------------------------------+-----------
matt | | {}
postgres | Superuser, Create role, Create DB, Replication, Bypass RLS | {}
ubuntu | | {}
我正在使用我梦想中的计算的ip address 作为我的主机并使用我的数据库、用户和密码,但收到错误消息:connection attempt time out。
有人可以请告诉我为什么会这样吗?我已经为此工作了 2 周,但我无法让它工作。
【问题讨论】:
-
你试过
ALTER ROLE matt WITH LOGIN;吗? -
@richyen 我是新手,但这会将其更改为
matt作为默认登录帐户?
标签: database postgresql ubuntu dbeaver