I use a normal connector to access a remote database, I decided to make access not on a straight line, but through an ssh tunnel.

There are several questions here: how critical will it be without ssh, and in general, are there any big advantages? Can a provider reject requests that go straight? If yes, then I have to smoke ssh. But it needs to rewrite a lot of code

So the main question is, you can somehow connect to the mysql server on port 3306, and then instead of the host, write localhost in the connection string? As if I am right on the server ...

Thank you all for the answers!

    1 answer 1

    There are several questions here: how critical will it be without ssh, and in general, are there any big advantages?

    If it is important for you that your traffic to MySQL is not overheard, then ssh can be used. And you can use SSL-based secure access. MySQL Connector / NET supports the use of SSL, does not support the use of ssh-tunnels, however there is a guide on the Internet on how to organize such a tunnel using the additional component sharpSSH . You can also use a commercial product, such as Devart dotConnect for MySQL . It has internal support for ssh connection.

    Can a provider reject requests that go straight?

    If we are talking about a hosting provider, it can. Frequently, hosting providers have no direct access “outside” to MySQL, but sometimes it is possible in the control panel to set the IP address (s) from which you can easily connect to port 3306 to the MySQL server.

    So the main question is, you can somehow connect to the mysql server on port 3306, and then instead of the host, write localhost in the connection string? As if I am right on the server ...

    Can. For this there is a program mysql-proxy. It runs on your computer and connects to the MySQL server. And client programs connect to mysql-proxy on localhost. Read more ...