If you have a closed machine that doesn’t allow MySQL connections from the outside world but does allow SSH access in to the box, say hello to the world of SSH tunneling.
The concept is simple. Bind one of your local machine’s port via a SSH connection to another box on the outside. For example:
ssh -N -L 3307:127.0.0.1:3306 userName@remoteHost &
The above is simply linking the remote machine’s MySQL server on port 3306 to your local machine’s port 3307. In other words, you can now connect to the MySQL server on the remote machine by connecting to localhost:3307.
Nifty.
You might also enjoy:
-
To delete a user account from a MySQL server instance, we need to make use of a DROP USER call to the mysql.user table. First, fire up MySQL in your ter ...
-
For the most part, the default port for SSH access into a Linux machine is 21. However, many people change this default in the name of security, meaning tha ...
-
Although port 21 is the default port used for SSH connections and thus SCP, most of the time you will find that in order to increase protection, the actual ...
-
To create a user account from a MySQL server instance, we need to make use of a CREATE USER call to the mysql.user table. First, fire up MySQL in your t ...
-
SCP is a powerful utility that allows us to securely copy files between remote machines. What makes it even more powerful is the ability to add it to script ...