Connect to MySql database #1435
-
My hosting provider requires a SSH tunnel to connect to my MySql database. I want to access the database using a program written in C#. The program is for .NET Framework 4.8.1. I'm used to connect to MySql databases in C#, but never via SSH. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
You could try port forwarding. You can set up the initial SSH connection to the database server and use it as the encrypted tunnel. Afterwards you can just add a forwarded port to the remote server and connect locally to the database port. I only recently started using local port forwarding for my app to pass through a bastion host. I am no pro and wouldnt know which type of forwarding would fit your situation, maybe dynamic or remote. It is something you could look into, just a thought. |
Beta Was this translation helpful? Give feedback.
You could try port forwarding. You can set up the initial SSH connection to the database server and use it as the encrypted tunnel. Afterwards you can just add a forwarded port to the remote server and connect locally to the database port. I only recently started using local port forwarding for my app to pass through a bastion host. I am no pro and wouldnt know which type of forwarding would fit your situation, maybe dynamic or remote. It is something you could look into, just a thought.