我在一个本地网络中托管了PostgreSQL数据库。在四百万和其他博客的帮助下。我能够管理从其他计算机连接数据库。我修改了PostgreSQL配置文件以允许所有IP访问数据库。
我可以连接到数据库。但我看不见其中的任何一张桌子。我正在使用pgAdmin工具连接。Pgadmin工具正在连接,我看到了所有的活动,但是我可以查看任何一个表。
发布于 2020-02-05 12:49:08
解决:-通过以下方法。
我发现在系统10 & 12中安装了两个postgresql。我连接到12的db。但是openproject表安装到10。所以我卸载postgresql 12。我配置postgresql以允许配置文件中的所有ip。重新启动postgresql之后。我能看到所有的桌子。非常感谢大家的帮助
发布于 2020-02-03 05:40:08
有几件事,您有为特定数据库创建表的特定模式吗?
此外,当您说您已连接到数据库时,我感到您是连接到默认的db "Postgres“,而不是您的用户db。
若要在pgamdin中切换数据库,请单击左侧的数据库,然后双击或连接到用户数据库(您的db),您应该能够看到其中的表。
尝试一下,如果它不能工作,您可以始终使用终端连接到数据库,使用下面的命令:
psql -h hostname -d databasename -U username 这将提示输入密码,输入pass并使用下面的命令列出db的
\l >>>列出dbs。
如果您连接到postgres并希望切换用户:
\c databasename一旦连接到具有表的db,请使用以下方法列出它们:
\dt希望这能有所帮助!
发布于 2020-02-05 08:14:40
请查找下面的详细信息。
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,我想访问这些表。
https://stackoverflow.com/questions/60033370
复制相似问题