Open mysql database to access from more than localhost
Normally I use my vps to host websites. But now I have a customer that needs to host a mysql database, and access the database from a Java application. The app is installed in a few netbooks and the netbooks are travelling around the country, using different kind of connections to connect to the server (mobile connections, a wifi connection in a MC Donalds, a wifi at home, a lan at work…).
Wich is the best and more secure way to give access to this Java application to (and only to) this mysql database?
I hope you understand my bad English.
Thanks in advance,
R. Campos.
5 Replies
Forward local port 3306 to remote port 3306, through the tunnel.
ssh -L 3306:localhost:3306 username@hostname
Tell Java app to connect to local port 3306.
Or choose any other local port.
I will try to modify the Java app to do the tunneling, using the JSch library.
Thanks in advance.
R. Campos.
@empoweringmedia:
newer versions of mysql offer SSL support. IMHO the better than SSH (because of the overhead of SSH).
The advantage of JSch is that the server continues to only expose SSH, your solution requires exposing a new SSL server, one more thing to worry about being exposed to the Internet.