Postgresql localhost connection - Connection refused

核能气质少年 提交于 2021-02-11 06:21:41

问题


i just installed pgadmin iii and try to connect server.

I configured my setting

name:localhost
host: 127.0.0.1
port:5432

username:postgres

but i always get this error

The server doesn't accept connection: the connection library reports **could not connect to server : Connection refused Is server runing on host "127.0.0.1" and accepting TCP/IP connections on port 5432?

However, i'm runing django and python on 127.0.0.1 What's missing?

There's also a problem with mysql. I could not connect with them


回答1:


If you change the pg_hba.conf file to accept connections (for example: "host all all 127.0.0.1 255.255.255.0 trust") it should work




回答2:


Installing postgre v12 before uninstalling v11 I found the config file (postgresql.conf) had a line "port = 5433". Changing this to "port = 5432" fixed the issue for me.



来源:https://stackoverflow.com/questions/10823534/postgresql-localhost-connection-connection-refused

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!