Question

Error When connecting PostgreSQL database in Digital ocean from my local PC

Posted December 16, 2020 422 views
DigitalOceanPostgreSQLDatabasesNeeds Product Answer

This is what I did to create a Database instance and access it
Step 1 : I created my DB instance in digital ocean then I made my IP address as trusted source , got the credentials (host name , db name , user , password) to access it .
Step 2 : downloaded postgreSQL to my local PC , opened the psql terminal window , and typed the credentials .
Now I get an error .

psql: error: SSL SYSCALL error: Connection reset by peer (0x00002746/10054)
FATAL:  no pg_hba.conf entry for host "123.231.108.177", user "bconic_survey_admin", database "bconic_survey", SSL off

Have I done any mistake upto here ?

edited by alexdo

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
Submit an Answer
1 answer

Hello, @tharikr

I will recommend you to double check our existing tutorial on how to connect to PostgreSQL databases here:

How to Connect to PostgreSQL Database Clusters

As for the error message itself, I think the crucial problem is the “SSL off” part.

The only required parameter is sslmode. If you notice, the connection string that DigitalOcean provides has “sslmode=require”

You can make sure that ssl is set to yes and give it another try.

Hope that this helps!
Regards,
Alex