Jump to content

[Solved] Daskunk Postgresql


daskunk

Recommended Posts

I was trying to figure this out on my own by reading various posts and I'm not sure if the problem is on my side or not. I recently created a Postgresql database and now I'd like to access it through a PHP script from my heliohost web site.

The pg_connect call in my PHP script looks like
 
$result=pg_connect("host=ricky.heliohost.org port=5432 dbname=daskunk_DaSkunkWorksPBC user=daskunk_php password=*****");


I'm getting this response

Warning: pg_connect(): Unable to connect to PostgreSQL server: FATAL: no pg_hba.conf entry for host "64.62.211.134", user "daskunk_php", database "daskunk_DaSkunkWorksPBC", SSL off in /home/daskunk/public_html/pbc/

psql.php on line 11

I've seen some posts indicating remote access is disabled by default and we have to ask your support team to enable it.

 

My info
Database:  daskunk_DaSkunkWorksPBC
User:      daskunk_php
Domain:    daskunk.heliohost.org
Server:    ricky

Any help in resolving this is greatly appreciated. Thank you in advance.

Link to comment
Share on other sites

I tried both

$connessione=pg_connect("host=localhost dbname=daskunk_DaSkunkWorksPBC user=daskunk_php password=<removed>") or die("Database non disponibile");

which resulted in

Warning: pg_connect(): Unable to connect to PostgreSQL server: FATAL: no pg_hba.conf entry for host "::1", user "daskunk_php", database "daskunk_DaSkunkWorksPBC", SSL off in /home/daskunk/public_html/pbc/psql.php on line 12

 

and

$connessione=pg_connect("host=localhost.heliohost.org dbname=daskunk_DaSkunkWorksPBC user=daskunk_php password=<removed>") or die("Database non disponibile");

which resulted in

Warning: pg_connect(): Unable to connect to PostgreSQL server: could not translate host name "localhost.heliohost.org" to address: Name or service not known in /home/daskunk/public_html/pbc/psql.php on line 12

 

So if neither is correct syntax, can someone please help with the correct syntax.  Otherwise is one of them is correct usage of localhost, then that is not working either.

 

I would really like to get my postgresql db working from my web site.

 

Thank you

Edited by Krydos
removed password
Link to comment
Share on other sites

Reverted back to the first one and tried again.

$dbconn=pg_connect("host=localhost port=5432 dbname=daskunk_DaSkunkWorksPBC user=daskunk_php password=*****")

 

 

Still getting this error

Warning: pg_connect(): Unable to connect to PostgreSQL server: FATAL: no pg_hba.conf entry for host "::1", user "daskunk_php", database "daskunk_DaSkunkWorksPBC", SSL off in /home/daskunk/public_html/pbc/psql.php on line 12

Link to comment
Share on other sites

$dbconn=pg_connect("host=localhost port=5432 dbname=daskunk_DaSkunkWorksPBC user=daskunk_php password=*****")

I tried that exact same code with my Ricky account, and it works perfectly. What is the link to your script?
Link to comment
Share on other sites

THANK YOU SO MUCH!  When I initially created the daskunk_php userid (weeks ago now) it was my first time working with the Postgresql admin tools and I could've sworn I not only created the user id but added it to the database.  I went through and tried adding it again just now, and it says it was submitted successfully. So now when I run the php script I'm past the pg_connect error and on my way with actual queries!! I can't tell you how much I appreciate your help. Thank you again.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...