Connection to private DB

Lucas Escudero 191 Reputation points
2022-12-07T18:07:09.083+00:00

Hello good afternoon, I want to tell you that I have a VM (Ubuntu 20.04) and a BD (Mysql).
The database has a private connection, so if I want to connect from my computer via MariaDB, Navicat, or similar, I won't be able to, since it's private.
How can I connect from any of these software while keeping the database connection private?
I understand that there should be an option to do this.
From the VM I can connect to mysql normally, but from my personal machine I can't access the DB.

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
9,013 questions
Azure Database for MySQL
Azure Database for MySQL
An Azure managed MySQL database service for app development and deployment.
986 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Cristian SPIRIDON 4,486 Reputation points Volunteer Moderator
    2022-12-10T08:44:33.72+00:00

    Hi,

    You can ssh into your Azure VM and use Local Port Forwarding:

    https://linuxize.com/post/how-to-setup-ssh-tunneling/

    Please see Local Port Forwarding section in the blog post from above.

    Hope this helps!

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.