Browse DevX
Sign up for e-mail newsletters from DevX


Use SQLyog Tunneling for Secure MySQL Server Management : Page 3

Have your ISP's security policies blocked remote access to your MySQL server? Learn how to securely connect to and manage a restricted MySQL server using SQLyog's HTTP and SSH tunneling features.




Building the Right Environment to Support AI, Machine Learning and Deep Learning

Benefit of SSH Tunneling
Many hosting companies that provide MySQL hosting block access to the MySQL server from outside the hosting company's network and grant access only to users connecting from localhost or from a machine within the network. The major benefit of SSH tunneling is that it allows you to connect to a MySQL server from behind a firewall when the MySQL server port is blocked (see Figure 3). As long as the hosting company provides SSH access, you can still connect through SQLyog's SSH Tunneling option.

Figure 3. SSH Tunneling Architecture

Setting Up SQLyog for SSH Tunneling
Select the Tunnel tab in the connection window (see Figure 4) and provide the information listed in Table 1.

Username: Username to access the SSH server
Password: Password to access the SSH server
SSH Host: Address of the machine on which SSH server is running
SSH Port: Port on which SSH server is listening (22 by default)
Localhost: Value always is localhost and read-only, because SQLyog creates the SSH port forwarding option on the local machine only
Local Port: Port on which SQLyog will listen locally for correctly port forwarding MySQL requests. (Note: If you are connecting to two (or more) MySQL servers, then you need to provide two different local port values in the respective connections.)
Table 1. SSH Connection Settings Information

Figure 4. SQLyog SSH Tunneling Settings

To understand the setup better, connect to a MySQL server using the following real life example:

  • Your Web site is hosted on the Web server, which also hosts a SSH server that runs and listens on port 22.
  • Your MySQL server is located on server, and it allows connections only from localhost or another machine within the same network (i.e.,
  • You publish your Web site on using the username and password your ISP provides (for this example, the username and password are ssh_user and ssh_pwd, respectively).

To complete the setup for this example, you have to input the following values for various server and tunnel options:

Server Tab
MySQL Host Address
Username Your mysql user name
Password Your mysql password
Database The database that you want to connect to (You can leave this field blank.)
Port The port MySQL is listening (3306 by default)
Tunnel Tab
Username ssh_user
Password ssh_pwd
SSH Host
SSH Port 22
Local Host Always localhost
Local Port Any port that is unused on your local machine (If you don't have a MySQL running on your machine, you can provide 3306.)

Press Connect to log into your server, and you can then use SQLyog and SSH tunneling to securely and efficiently manage your MySQL database.

Secure Connectivity with SQLyog
SQLyog gives you a choice of connectivity options. No matter what your firewall/proxy/ISP settings are, you should be able to use it to smartly manage your MySQL server(s).

Karam Chand is a freelance PHP/MySQL developer based in Bangalore, India.
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



Thanks for your registration, follow us on our social networks to keep up-to-date