1

Hello i am a beginner to postgresql, I am unable to connect Postgresql database on linux system from windows through pgadmin client . I am getting the following error

FATAL: no pg_hba.conf entry for host "192.168.1.42", user "postgres", database "postgres", SSL off 

Kindly suggest me how to do.Thanks in advance

2 Answers 2

6

On the db server, edit your pg_hba.conf file and add a line similar to this:

host    all             all             192.168.1.42/32            md5

If you don't want to use a password (I won't get into the security aspects), you can switch the "md5" for "trust". If you only want to allow the postgres user access to the postgres maintenance database, then switch both "all" words with "postgres" (no quotes).

You'll need to reload the config files after making any changes. Eg.

pg_ctl reload

or

select pg_reload_conf(); -- as the superuser

If you don't know which pg_hba.conf file your database cluster is using, if you can connect to any of the databases, issue select current_setting('hba_file');

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

1 Comment

1

by default, postgresql deny all connexion if it's not from "localhost" here is a link for you : https://wiki.debian.org/PhpPgAdmin

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.