首页 > 解决方案 > 如何从外部网络查看 postgresql 数据库中的所有表?

问题描述

我在本地网络之一中托管了 PostgreSQL 数据库。在fourm和其他博客的帮助下。我可以管理从其他计算机连接数据库。我修改了 PostgreSQL 配置文件以允许所有 IP 访问数据库。

我可以连接到数据库。但我无法查看其中的任何表格。我正在使用 pgAdmin 工具进行连接。Pgadmin 工具正在连接,我看到所有活动,但我可以查看任何表。

标签: postgresqlpgadmin

解决方案


请在下面找到详细信息。

root@OpenProject:/home/XXXXXXXX# psql -h 192.168.1.146 -d openproject -U vivek 
Password for user vivek:  
psql (12.1 (Ubuntu 12.1-1.pgdg18.04+1)) 
SSL connection (protocol: TLSv1.3, cipher: TLS_AES_256_GCM_SHA384, bits: 256, compression: off)
Type "help" for help.

openproject=> \l openproject=> \c SSL connection (protocol: TLSv1.3,
cipher: TLS_AES_256_GCM_SHA384, bits: 256, compression: off) You are
now connected to database "openproject" as user "craftsilicon".
openproject=> \dt Did not find any relations. openproject=> \l
                                List of databases
    Name     |  Owner   | Encoding | Collate | Ctype |     Access privileges     
-------------+----------+----------+---------+-------+---------------------------  
 openproject | postgres | UTF8     | en_IN   | en_IN | =Tc/postgres    +
             |          |          |         |       | postgres=CTc/postgres    +
             |          |          |         |       | craftsilicon=CTc/postgres  
 postgres    | postgres | UTF8     | en_IN   | en_IN |   
 template0   | postgres | UTF8     | en_IN   | en_IN | =c/postgres              +
             |          |          |         |       | postgres=CTc/postgres  
 template1   | postgres | UTF8     | en_IN   | en_IN | =c/postgres              +
             |          |          |         |       | postgres=CTc/postgres 
(4 rows)

openproject=> \c SSL connection (protocol: TLSv1.3, cipher:
TLS_AES_256_GCM_SHA384, bits: 256, compression: off) You are now
connected to database "openproject" as user "craftsilicon".
openproject=> \dt Did not find any relations.

我不知道,openproject 的表存储在哪里,我想访问这些表。


推荐阅读