Connect to DB installed into dedicated VPS (private networking)

January 10, 2016 3.8k views
MySQL Security Ubuntu Firewall LEMP System Tools

Hi, what is the best and secure way to connect to MySQL DB via Sequel PRO or MySQL Workbench, hosted into a dedicate VPS that is connected to app servers via private networking?
If MySQL daemon is listening to private IP, it will not be available from public IP (obviously, I’m scared about exposing my DB droplet to public internet).

I’m using the 2nd server configuration illustrated in this guide (, called “Separate Database Server”.

Thanks a lot

1 Answer

Hey there,

There would be a few ways you could accomplish this. I’d recommend the straight forward option of connecting via SSH with Sequel Pro. You can enter in the SSH details of your database server along with your MySQL details and you would not need open port 3306 up to the public or make MySQL listen on the public interface.

Their documentation is sparse, but you'r looking for the SSH tab when creating a new connection.

Thank you and please let us know if there is anything else we can do for you.

Happy coding,

Jon Schwenn
Platform Support Specialist

  • Thank you, so much!
    Is there any way to connect to server, avoiding to open any port to public interface?
    I don’t like the idea to open a DB’s VPS port to internet.
    I’m thinking a solution like connect to another server (via ssh) and then to DB… is it possibile?
    Is there a solution that allows me to keep all public port closed into DB’s VPS ?

    Thank you so much!

    • You may be able to use the SSH details for the app server - and the private IP of the DB server in that SSH connection configuration of Sequel Pro.

      Otherwise there would be a few ways to add security into the mix between VPN and firewall configurations.

Have another answer? Share your knowledge.