我刚刚将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
问题的副本
PostgreSQL数据库服务
浏览这个线程,因为它陈述了多种解决方案
https://stackoverflow.com/questions/24917832/how-connect-postgres-to-localhost-server-using-pgadmin-on-ubuntu
通过网络访问PostgreSQL
在文件/etc/postgresql/{version_number}/main/postgresql.conf
中将listen_address
localhost更改为*
# - 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