Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Secure Remote mySQL Connection

Since our shared hosting server doesn't allow us to setup Tomcat I decided to install it on our local machine. The local Tomcat server allows us to listen to a certain port for Bancnet transactions which will then be processed and written to the remote site.

Question: Is it safe for me to set the local PHP application to connect directly to the remote mySQL server? Any suggestions on how to make the connection secure. BTW, I have a self-signed certificate installed in the localhost but not sure how this applies to remote mySQL connection.

like image 829
Jhourlad Estrella Avatar asked Jun 03 '11 03:06

Jhourlad Estrella


People also ask

Are MySQL connections secure?

MySQL supports encrypted connections between clients and the server using the TLS (Transport Layer Security) protocol. TLS is sometimes referred to as SSL (Secure Sockets Layer) but MySQL does not actually use the SSL protocol for encrypted connections because its encryption is weak (see Section 6.3.

Is MySQL port 3306 encrypted?

MySQL uses 3306 instead (and can use SSL over this port or any other to encrypt the connection). So, setting up SSL encryption for a MySQL connection doesn't affect the used port.


1 Answers

You could create a ssh tunnel between MySQL server and client. For more resiliency, use autossh.

like image 56
mindas Avatar answered Oct 05 '22 20:10

mindas