pgAdmin无法连接到本地数据库服务器

时间:2020-08-17 15:36:03

标签: postgresql pgadmin

我刚刚将pgAdmin更新为4.23版,将PostgreSQL更新为版本12。我还删除了所有以前的数据库和pgAdmin安装。因此,它应该是全新安装的(我也清除了以前版本的所有其余部分)。

现在,当我尝试连接到本地数据库服务器时,我什至可以输入密码:

could not connect to server: Connection refused (0x0000274D/10061)Is the server running on host "localhost" (::1) and accepting TCP/IP connections on port 5433? could not connect to server: Connection refused (0x0000274D/10061) Is the server running on host "localhost" (127.0.0.1) and accepting TCP/IP connections on port 5433?

该服务正在运行,我可以使用命令行工具并且它可以正确响应,但是由于某些原因我不能使用pgAdmin。

>psql -V
psql (PostgreSQL) 12.3

2 个答案:

答案 0 :(得分:0)

您的问题的重复

https://stackoverflow.com/questions/4482239/postgresql-database-service

查看该线程,因为它指出了多个解决方案

https://stackoverflow.com/questions/24917832/how-connect-postgres-to-localhost-server-using-pgadmin-on-ubuntu

答案 1 :(得分:0)

通过网络访问PostgreSQL

将文件listen_address中的*本地主机更改为/etc/postgresql/{version_number}/main/postgresql.conf

# - Connection Settings - 
listen_addresses = '*'          # what IP address(es) to listen on;     

pg_hba.conf

中的更改

在#IPv4本地连接中添加以下行:

host    all             all             0.0.0.0/0               md5

并评论

#host    all             all             127.0.0.1/32            md5