database - 无法连接到 ubuntu 上的 postgres

标签 database postgresql ubuntu dbeaver

我在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)
如您所见,您看不到Superuser和数据库 strapimatt用户名。
                                   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 .
enter image description here
有人可以告诉我为什么会这样吗?我已经为此工作了 2 周,但我无法让它工作。

最佳答案

错误消息是 connection time out .这通常意味着该端口被防火墙阻止。检查您的云提供商防火墙设置和iptables在你的 Linux 盒子里,以防你已经安装了它。
如果权限有问题,则错误消息将是其他内容。

关于database - 无法连接到 ubuntu 上的 postgres,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66608945/

相关文章:

c++ - 在ubuntu中编译c++程序

apache - 从服务器请求文件多少次?

c++ - Linux Ubuntu下绕行功能

php - Codeigniter - 如何避免用户多次登录将其 session 存储在数据库中

android - 在 Root 手机上读取/data/data/****/**.db

mySql:获取单元格中单词数(字符串逗号分隔)与匹配单元格具有相同值的行

sql - postgres查找同一列数字之间的差异

sql - postgres - 保留查询中的重复项

database - Magento 下拉属性标签

postgresql - Slony、pgAdmin 和集群复制的问题