Finally you are ready to connect to your MySQL server in SSH, because the port forwarding at local port 3307 has been enabled. Suppose you have the following MySQL log-in information below:
MySQL username: codexm
MySQL password: coolguy
It's VERY IMPORTANT that you execute step 2 while Putty is still connected to your SSH server. Do not disconnect the Putty connection that you made in step 1 or else you will not be able to connect to your MYSQL server in step 2.
Follow the procedure below.
1. Launch HeidiSQL.
2. Click "New" in the Session Manager.
3. Configure the following:
Network Type: TCP/IP
Compressed client/server protocol: Checked
After entering the details above, it should look like the screen shot below:
4. Click OPEN. If there are no errors, you have successfully connected to your MySQL server using SSH, and HeidiSQL will then show you your databases.
Using MySQL Query Browser
If you are using the MySQL Query Browser, follow the procedure below.
1. Launch MySQL Query Browser.
2. Configure the options below:
Stored connection: (leave this blank)
Server hostname: 127.0.0.1
Default schema: (leave this blank)
After entering the above configuration details, it should look like the screen shot below:
There are two important things you need to note regarding the use of MySQL GUI.
First, there may be times when you can not establish a connection to your MySQL server even though you have perfectly followed the steps outlined in this tutorial. If this happens, you need to contact your web host and report that error. This might be due to some MySQL server restrictions they have imposed.
Second, if you are not certain as to whether your connection has been encrypted, you can inspect the packets going out of your network card using Wireshark and compare them with the packets leaving your computer using an unencrypted MySQL session. The recommended test procedure, if you are interested in doing this, is as follows:
Step 1: Install Wireshark.
Step 2: Hit capture to make Wireshark capture packets from your network interface card.
Step 3: Just seconds after hitting capture, log in to your MySQL server using phpMyAdmin "unencrypted."
Step 4: Immediately after pressing login (around three seconds later), hit stop capture.
Step 5: Look for any POST entry in the packets gathered. You will surely get your username and password in "clear text" because they are not encrypted.
Now, using your MySQL GUI and Putty, configure them so that they will connect to your MySQL server using SSH. Repeat steps 1 and 2 above. In step 3, instead of hitting the login button in phpMyAdmin, you will hit the Connect/Open button in MySQL GUI.
Just seconds after hitting "Connect," hit stop capture in Wireshark. If you examine those capture packets very closely, you will not be able to understand them because they are not in "clear text form;" instead, they are encrypted.
blog comments powered by Disqus