Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

skoobi's avatar
Level 13

Connecting to Database from local machine

Hi.

I've got 2 servers setup with Digital ocean which was provisioned using forge. I have one as an app server and the other a database server.

I can connect using ssh tunnel on sequel pro but unless I add my IP to the firewall in forge, I cannot connect to the server when using local dev. I try to use a testing db on the server so when I'm away from the office I can carry on with local dev with the same data.

Any ideas on how to allow my local computer to connect ??

Cheers

0 likes
4 replies
ejdelmonico's avatar

For security reasons, your DB server needs whitelisting and Forge will allow a basic connection. However, you really should lock it down further on the server. The DB server should be set up so that only specific IP address' and ports can access it. That is probably the cause of your issue. You should still be able to ssh into the DB server with the installed ssh key. Password access should be blocked by default with Forge.

skoobi's avatar
Level 13

Sorry for the late reply guys...

I tried the tunnel but doesn't work for some reason. Once I have a bit more time to check it out I'll post back.

What ive done for now is used Brew to install MySQL on my local machine and MacBook and then just used it like that without connecting to the test DB server. Its a bit of a pain as I don't have the same data throughout all machines but I can live with it.

skoobi's avatar
Level 13

Sorry! Found the issue. Changed the port to 3307 and all worked. Cheers @d

Please or to participate in this conversation.