PostgreSQL : failed: FATAL: no pg_hba.conf entry for host
I get following error when I try to connect using DBI
DBI connect('database=chaosLRdb;host=192.168.0.1;port=5433','postgres',...) failed: FATAL: no pg_hba.conf entry for host "192.168.0.1", user "postgres", database "myDatabase", SSL off
Tagged:
0
Answers
-
First look for
pg_hba.conf
, you can use locate command to do solocate pg_hba.conf
Then edit the file on your favorite editor
vi /var/lib/pgsql/9.6/data/pg_hba.conf
Add the following line to the file
host all all 192.168.0.1/32 md5
In order to apply changes, you must reload the service. In my case, I have pg version 9.6 so commands will be
service postgresql-9.6 reload service postgresql-9.6 status
1
Howdy, Stranger!
Categories
- 94 All Categories
- 20 VoIP
- 7 SIP
- 16 asterisk
- 44 Programming
- 1 Nodejs
- 4 javascript
- 19 PHP
- 8 Codeigniter
- 14 database
- 1 UI/UX
- 2 Flutter
- 28 OS
- 26 Linux
- 1 Virtualization
- 1 Android
- 1 Windows
- 2 legal