我正在尝试使用 PostgreSQL 数据库启动 PGadmin4,但是当我访问时http://localhost/pgadmin4
,我一直在登陆
127.0.0.1 refused to connect
。
在 Postgresql 之后,我启动了数据库并且服务器似乎可以工作:
~ sudo systemctl status postgresql
● postgresql.service - PostgreSQL RDBMS
Loaded: loaded (/lib/systemd/system/postgresql.service; enabled; vendor pr>
Active: active (exited) since Wed 2021-05-05 17:44:13 CEST; 11min ago
Process: 8826 ExecStart=/bin/true (code=exited, status=0/SUCCESS)
Main PID: 8826 (code=exited, status=0/SUCCESS)
mai 05 17:44:13 hysterio-Zephyrus-G-GU502DU-GA502DU systemd[1]: Starting Postgr>
mai 05 17:44:13 hysterio-Zephyrus-G-GU502DU-GA502DU systemd[1]: Finished Postgr>
并且标准端口 5432 正在通过正确的进程进行侦听:
sudo lsof -i tcp:5432
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
postgres 10886 postgres 5u IPv4 134729 0t0 TCP *:postgresql (LISTEN)
postgres 10886 postgres 6u IPv6 134730 0t0 TCP *:postgresql (LISTEN)
PGadmin4 的安装需要安装 apache 网络服务器,并且安装正确:
We can now configure the Apache Web server for you. This involves enabling the wsgi module and
configuring the pgAdmin 4 application to mount at /pgadmin4. Do you wish to continue (y/n)? y
The Apache web server is running and must be restarted for the pgAdmin 4 installation to complete. Continue (y/n)?
Apache successfully restarted. You can now start using pgAdmin 4 in web mode at http://127.0.0.1/pgadmin4
我尝试编辑 pg_hba.conf 文件和 postgresql.conf 文件以确保数据库正在侦听 localhost (127.0.0.1) 上的 5432,但它没有做任何事情。
有任何想法吗?