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?