Report this

What is the reason for this report?

My newly created db is not connecting.

Posted on December 10, 2023

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



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!

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.

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

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

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Start building today

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.

Dark mode is coming soon.