0

I add a server and there are Error like this image

I use pgadmin4

How I can Fix this?

3
  • 1
    Is your Postgres database server enabled remote access? Commented Aug 21, 2017 at 4:22
  • I dont know, how to check it? Commented Aug 21, 2017 at 5:21
  • Ok, I will post the detail steps in a separated answer. Commented Aug 21, 2017 at 5:59

1 Answer 1

1

Firstly, check if the server is listening. Use the following command on your server:

netstat -nlt|grep :5432 

If it's ok, SSH (or whatever method you use to access the server) to your server and view the file:

/etc/postgresql/9.1/main/postgresql.conf 

Find the line start with:

listen_addresses= 

If the value after "=" is 'localhost', it means that you cannot connect from outside. To be able to do so, change it to:

listen_addresses='*' 

Now you will be able to connect from anywhere, outside from the server itself. And, don't forget to restart you DBMS and check if it works.


Ah. One more thing, you may also need to give your user access rights to your database as well.

Open the file:

/etc/postgresql/9.1/main/pg_hba.conf 

And add:

host all all * md5 

You also need to restart you DBMS to fire up changes.


P/s: You should enable SSL.

Sign up to request clarification or add additional context in comments.

8 Comments

How to SSH to the server? Sorry newbie here, I use windows 10
SSH is an option. You can ssh or use whatever method you use to access the server.
how to access SSH server in Heroku?
"No app specified"
Cd to your local app's folder. Run the command, its result's something close to ssh: heroku run bash
|

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.