0

I've written a program in C++ which stores data to a local MySQL database every 5 seconds. Now I need to store the data on webhosted MySQL database which is remote (the webhosting provides remote access). I think it will be easy to rewrite the program to connect to remote server, but I have a different problem.

Can I make the connection secure (encrypted)? I'm afraid that the password can be sniffed. Must the server support anything special to make it possible?

I thought of allowing remote connections to the database from only one specific IP address (my public static IP), which will prevent anybody else from connecting to the database (unless they hack into my WiFi and sniff my password). So I wouldn't have to worry if someone sniffed my password?

What solution would you recommend to me?

4

1 回答 1

0

解决此类问题的一种方法是使用 ssh 隧道连接到远程主机。我没有具体的公式,但是可以设置像 putty 这样的 SSH 客户端来侦听本地端口并连接到连接另一端本地的远程端口。

您将使用 ssh 登录到远程主机,然后打开与本地端口的 mysql 连接,这将产生在 ssh 连接的另一端打开本地连接的效果。

于 2013-04-08T22:16:33.940 回答