Question

My newly created db is not connecting.

My newly created db is not connecting https://prnt.sc/xZYdeGb0q0A2


Submit an answer


This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

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.

alexdo
Site Moderator
Site Moderator badge
December 11, 2023

Heya, @codewizardgenius

On top of what Bobby mentioned you can also check our docs on how to connect to a managed PostgreSQL database. As mentioned this might be an issue with the IP address not being whitelisted.

https://docs.digitalocean.com/products/databases/postgresql/how-to/connect/

Regards

Bobby Iliev
Site Moderator
Site Moderator badge
December 11, 2023

Hi there,

The error in the screenshot indicates that this could be caused by a couple of different reasons:

  1. Use the Correct Database Port:

    • Ensure you are using the correct port specified by DigitalOcean for your managed PostgreSQL database. For PostgreSQL, the default port is typically 5432, but DigitalOcean might assign a different port for managed databases. You can find this information in your DigitalOcean control panel under the database’s settings.
  2. Allow Your IP Address:

    • If you have enabled ‘Trusted Sources’ in your DigitalOcean database settings, make sure that your current IP address is allowed. If your IP address isn’t whitelisted, you won’t be able to establish a connection.
    • You can check your current IP address by visiting ifconfig.io from the computer you are trying to connect from.
    • Once you have your IP address, add it to the list of trusted sources in your DigitalOcean database settings.
  3. Check Database Credentials:

    • Verify that you are using the correct credentials (username, password, database name) provided by DigitalOcean. These details are crucial for establishing a successful connection.
  4. SSL Connection:

    • DigitalOcean Managed Databases requires SSL connections. Ensure your database connection string includes SSL parameters. You might also need to download and reference the CA certificate provided by DigitalOcean.

Let me know how it goes!

Best,

Bobby

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.

Become a contributor

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow — whether you're running one virtual machine or ten thousand.

Learn more
DigitalOcean Cloud Control Panel