Question

Connect a webserver to a database server in a different project

I am at my whit’s end. I have 2 projects. Project #1 has a webserver and a database. I am trying to create another webserver in project #2 to connect to the database in project #1.

I am pretty sure everything is setup correctly…I am just getting the following error message: “PHP Warning: mysqli_real_connect(): (HY000/2002): Unknown error while connecting”.

What is weird is that I thought I had it working earlier today (following the exact same server setup scripts). So I don’t know if because I have had to redo this webserver so many times now the database server is refusing connections? I can telnet to it from the new webserver so that is likely not it (and I have flushed hosts).

Subscribe
Share

Submit an 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.

Yeah…not sure how to delete this one…but it turns out that in the process of migrating servers and upgrading to PHP7.3 I had a recursive script issue and it was trying to connect and was timing out after 30 seconds. If a Mod can kill this topic I don’t think there is any benefit for anyone else.

tldr; Yes, you can connect droplets across projects within your account. I am not sure if they all need to be in the same data center, but I would assume so.