on our Linux server we have PostgreSQL DB
when we type -
we get
what we need to set in the /var/lib/pgsql/data/pg_hba.conf in order to fix this?
Psql: FATAL: no pghba.conf entry for host “172.31.37.251”, user “postgres”, database “postgres”, SSL off Hot Network Questions Having some issue with notation in a Hilbert space. Connection to database failed: FATAL: no pghba.conf entry for host. Introduction: I am working on an application that connects to a postgres database using the libpq API. As a requirement the.
1 Answer
To list the databases, you can execute your command as postgres
user:
If you are already logged in as root, you can remove sudo
from the above command. User postgres
is considered as root user for PostgreSQL database engine.
The error shown in your post indicates that there is no access for user root
from localhost
to access postgres
database. So, you can edit pg_hba.conf
file to include the desired login details like login name, DB name, and host. The file is well documented.
For your case, you can add the following line to pg_hba.conf
file:
You need to reload your postgresql server after saving the changes.
KhaledKhaled![For For](https://i.stack.imgur.com/XAvsh.png)
![No Pg_hba.conf Entry For Host No Pg_hba.conf Entry For Host](http://www.tabvizanalytics.com/wp-content/uploads/2018/01/1.-Downloading.png)