Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

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

share|improve this question

2 Answers 2

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');

share|improve this answer
1  
See postgresql.org/docs/current/static/client-authentication.html and postgresql.org/docs/current/static/auth-pg-hba-conf.html for the associated documentation, which goes into further detail. –  Craig Ringer Aug 1 '13 at 16:58

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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.