0

Every time, when I try to connect to remote Postgres DB, I receive error:

 no pg_hba.conf entry for host "159.224.92.121", user "xpkzxqrkisdrjd", database "d92na0gp4bdq4", SSL off

I googled it and found that two config files should be updated.

Should append:

pg_hba.conf

host all all 0.0.0.0/0 md5

postgresql.conf

listen_addresses = '*'

I did it, but error still occurs, when I try to connect to remote DB. Local DB work fine.

Any ideas?

UPDATE

Maybe it will be useful. I have installed postgres using homebrew. For restarting postgres server I use:

brew services postgres restart

2
  • 1
    Told the server to reload configuration? Commented Jan 30, 2017 at 23:35
  • @SamiKuhmonen, yes, of course. Commented Jan 31, 2017 at 8:11

2 Answers 2

1

Two items to help you on the way:

  • pg_hba.conf is processed from top to bottom, so if the incoming connection matches an earlier line, that entry will be used.

  • Set log_connections = on in postgresql.conf and reload. Then, after a connection attempt has failed, look into the log file for the reason. Recent PostgreSQL versions will also tell you which pg_hba.conf line was used.

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

2 Comments

Thank you for notes, they are useful! But it didn't help me
Well, since you didn't tell anything about your setup and how you are trying to connect, all one can give is general help.
0

So, I continued to google this issue and finally found the answer. You should use SSL option.

Please, check this link: https://intellij-support.jetbrains.com/hc/en-us/community/posts/205996299/comments/206373089

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.