Question

IP of my database?

After installing software on my droplets, and installing things inside the software, it asked for a MySQL database. So I made a Digital Ocean database cluster, and make a new database, but it asks for the database IP? Where can I find the database’s address?


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.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

Use nslookup and it will give you the server IP, in this example it would be 1.2.3.4

bash-5.1#  nslookup "mydbname-do-user-12345678-0.b.db.ondigitalocean.com"
Server:   192.168.0.1
Address:  192.168.0.1:53

Non-authoritative answer:
Name: "mydbname-do-user-12345678-0.b.db.ondigitalocean.com"
Address: 1.2.3.4

** server can't find "mydbname-do-user-12345678-0.b.db.ondigitalocean.com": NXDOMAIN

Hi there @callmehSpear,

The DigitalOcean Managed Databases come with a hostname rather than an IP address.

You can use the hostname of your Managed Database and your application would work fine as well.

You just need to keep in mind that the Managed Databases come with a custom port rather than the default one for MySQL so you need to make sure that you specify the correct port.

Regards, Bobby