首页 文章

Windows 10上的Postgresql连接被拒绝错误

提问于
浏览
0

过去一周,我一直在尝试使用Ruby on Rails的postgres . 我第一次下载postgres时,有一个“密码未提供”问题,通过卸载和重新加载解决了这个问题 . 现在,我已尝试卸载并重新安装两次,因为我收到连接拒绝错误,看起来像这样,...“无法连接到服务器:连接被拒绝(0x0000274D / 10061)服务器是否在主机上运行”localhost“( :: 1)并接受端口5432上的TCP / IP连接?无法连接到服务器:连接被拒绝(0x0000274D / 10061)服务器是否在主机“localhost”(127.0.0.1)上运行并接受端口5432上的TCP / IP连接?” ...我查看了许多在线资源,包括stackoverflow,似乎没有任何帮助 . 这就是我的pg_hba.conf文件的样子....

# TYPE  DATABASE        USER            ADDRESS                 METHOD

# IPv4 local connections:
host    all             all             127.0.0.1/32            md5
# IPv6 local connections:
host    all             all             ::1/128                 md5
# Allow replication connections from localhost, by a user with the
# replication privilege.
#host    replication     postgres        127.0.0.1/32            md5
#host    replication     postgres        ::1/128                 md5

...这是我的postgresql.conf文件...

listen_addresses = '*'      # what IP address(es) to listen on;
                    # comma-separated list of addresses;
                    # defaults to 'localhost'; use '*' for all
                    # (change requires restart)
port = 5432             # (change requires restart)
max_connections = 100           # (change requires restart)
#superuser_reserved_connections = 3 # (change requires restart)
#unix_socket_directories = ''   # comma-separated list of directories
                    # (change requires restart)
#unix_socket_group = ''         # (change requires restart)
#unix_socket_permissions = 0777     # begin with 0 to use octal notation

大多数建议都基于这两个文件,这些文件已根据帖子的答案正确配置 . 我也试过禁用防火墙并重新启动postgres . 有人对我有什么建议吗?谢谢!

1 回答

  • -1

    [解决了]

    经过更多的研究 . 我深入研究了下载后收到的错误并找到了解决方案here

    对于有同样问题的人来说,祝你好运!

相关问题