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

Become a contributor for community

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

DigitalOcean Documentation

Full documentation for every DigitalOcean product.

Resources for startups and SMBs

The Wave has everything you need to know about building a business, from raising funding to marketing your product.

Get our newsletter

Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.

New accounts only. By submitting your email you agree to our Privacy Policy

The developer cloud

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

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.