问题
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