wambachr Posted October 28, 2020 Posted October 28, 2020 (edited) Hi, i'm using postgresql and php - it's running fine I recently added a second database user (wambachr_osmuser) and granted r/o access to my tables. This userid/password will be visible to any user reading the php-script. But that is ok for me. Now i'm getting error "Warning: pg_connect(): Unable to connect to PostgreSQL server: FATAL: no pg_hba.conf entry for host "65.19.143.6", user "wambachr_osmuser", database "wambachr_osm", SSL off in ..." That is Tommies ip address and i think this should be added to pg_hba_conf too. Better using Tommys name instead of ip address, i think. BUT i'm not 100% shure if this is the correct way, and you may tell me a better solution. regardswalter aka wambacherbtw: "osm" stands for https://OpenStreetMap.org Edited October 28, 2020 by wambachr
Krydos Posted October 29, 2020 Posted October 29, 2020 Does it work if you use localhost or 127.0.0.1 as the host?
wambachr Posted October 29, 2020 Author Posted October 29, 2020 (edited) sorry, no $dbconn = pg_connect("host=127.0.0.1 dbname=wambachr_osm user=wambachr_osmuser password=public");=> Warning: pg_connect(): Unable to connect to PostgreSQL server: FATAL: no pg_hba.conf entry for host "127.0.0.1", user "wambachr_osmuser", database "wambachr_osm", SSL off in /home/wambachr/public_html/getSoftware4.php on line 31 $dbconn = pg_connect("host=localhost dbname=wambachr_osm user=wambachr_osmuser password=public");=> Warning: pg_connect(): Unable to connect to PostgreSQL server: FATAL: no pg_hba.conf entry for host "::1", user "wambachr_osmuser", database "wambachr_osm", SSL off in /home/wambachr/public_html/getSoftware4.php on line 31 $dbconn = pg_connect("host=tommy.heliohost.org dbname=wambachr_osm user=wambachr_osmuser password=public"); => Warning: pg_connect(): Unable to connect to PostgreSQL server: FATAL: no pg_hba.conf entry for host "65.19.143.6", user "wambachr_osmuser", database "wambachr_osm", SSL off in /home/wambachr/public_html/getSoftware4.php on line 31$dbconn = pg_connect("host=65.19.143.6 dbname=wambachr_osm user=wambachr_osmuser password=public");=> Warning: pg_connect(): Unable to connect to PostgreSQL server: FATAL: no pg_hba.conf entry for host "65.19.143.6", user "wambachr_osmuser", database "wambachr_osm", SSL off in /home/wambachr/public_html/getSoftware4.php on line 31 $dbconn = pg_connect("host=wambachr.heliohost.org dbname=wambachr_osm user=wambachr_osmuser password=public");=> Warning: pg_connect(): Unable to connect to PostgreSQL server: FATAL: no pg_hba.conf entry for host "65.19.143.6", user "wambachr_osmuser", database "wambachr_osm", SSL off in /home/wambachr/public_html/getSoftware4.php on line 31even tried "no host" $dbconn = pg_connect("dbname=wambachr_osm user=wambachr_osmuser password=public");=> Warning: pg_connect(): Unable to connect to PostgreSQL server: FATAL: no pg_hba.conf entry for host "[local]", user "wambachr_osmuser", database "wambachr_osm", SSL off in /home/wambachr/public_html/getSoftware4.php on line 31regardswalter Testpage http://wambachr.heliohost.org/SoftwareWatchlist4.html will try to connect using "$dbconn = pg_connect("host=localhost dbname=wambachr_osm user=wambachr_osmuser password=public"); not working switching to real db admin and his db password will work. Edited October 29, 2020 by wambachr
Krydos Posted October 29, 2020 Posted October 29, 2020 Try localhost now. I compared the Johnny config to the Tommy config, and somehow I forgot to add the ipv6 localhost to Tommy when I set him up. It's odd that no one has noticed it before now.
wambachr Posted October 29, 2020 Author Posted October 29, 2020 (edited) Bingo! you got it. Thankswalter Edited October 29, 2020 by wambachr
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now