Connect a webserver to a database server in a different project

May 27, 2019 158 views

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: mysqlirealconnect(): (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).

1 Answer

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.

Have another answer? Share your knowledge.