Grafana connect to a non localhost datasource

I want to connect to a data source within my network. When I use localhost:5432 I can connect to my postgres database.
image

But when I connect to the database via my ipv4 address, the connections fails.
image

This is the grafana.log, when the connection fails:

logger=tsdb.postgres t=2022-03-27T12:21:23.88+0200 lvl=eror msg="query error" err="dial tcp 192.168.178.94:5432: connect: connection refused"
logger=context t=2022-03-27T12:21:23.88+0200 lvl=info msg="Request Completed" method=POST path=/api/ds/query status=400 remote_addr=192.168.178.40 time_ms=192 size=239 referer=http://192.168.178.82:3000/datasources/edit/6R0Swnynk

ipv4, not ipv6
Are you sure you have the right password for the 192.168.178.82:5432 postgresql instance ?

1 Like

The password is correct. The only thing that is changed, is the ip address. Localhost has the ip adress 192.168.178.82 in my network.

I have modified the postgresql.conf file:
image

Furthermore I had to grant all (you can do it more specific) ip-adresses access to my database via the postgresql.conf file: