1

I am setting up postgresql / pgadmin on my new macbook pro. However, when I register a new server, I get the error:

Server doesn't listen
The server doesn't accept connections: the connection library reports 
could not connect to server: Connection refused Is the server running on host "localhost" (::1) and accepting TCP/IP connections on port 5432? could not connect to server: Connection refused Is the server running on host "localhost" (127.0.0.1) and accepting TCP/IP connections on port 5432? 

I browsed this issue and apparently the answer is to edit the pg_hba.conf file. However, i need help with:

1) How do I find & open that file?

2) Once I open it, what statements do I need to add to fix the issue?

Can someone help?

Thanks in advance!

1

1 Answer 1

1

It is situated inside the data folder.

Eg: PostgreSQL\9.4\data\pg_hba.conf

There you will find the following place.

# IPv4 local connections:
host    all             all             127.0.0.1/32            md5

If you want to access from different IP add a copy of the same line changing the IP. Its well explained here.

And also I suggest you to check the postgresql.conf placed in the same directory for the following line whether its commented on not.

#------------------------------------------------------------------------------
# CONNECTIONS AND AUTHENTICATION
#------------------------------------------------------------------------------

# - Connection Settings -

listen_addresses = '*'      # what IP address(es) to listen on;
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.