Knowledge Essentials - 3Essentials Hosting

Secure MySQL Admin setup instructions using PLINK

Article ID: 38

 Back to Search


The following article describes how to use set up your system for a Secure MySQL Admin connection.

Prerequisites:
  • you will need to have previously submitted a support ticket requesting that Secure MySQL Admin access was enabled (and received a response that it was).
  • one of the following MySQL administrative interfaces: MySQL Front, MySQL Admin 1.0, MySQL Admin 1.1
  • you must have already created a MySQL database on our servers through the control panel, and you'll need the username/password for that.
  • you'll need your ftp username and password
  1. Download PLINK.EXE from the downloads section of this article
  2. There's no install for plink, simply put it whereever you wish. If you put it into your windowssystem32 folder, you'll then be able to access it from anywhere without having to specify the path.
  3. Open a command prompt on your local system (Click Start > Run > then type cmd > Click OK.)
  4. Initialize the connection by running the following in the CMD prompt:
    plink.exe webXX.3essentials.com (where XX represents the web server your domain is hosted on. If you're unsure, please ask support)
    and press Enter.
  5. If this is the first time you have connected using plink you will get prompted to accept the key, type y or yes and press .
  6. Close the plink command window. (click the X in top right corner)

That completes the initial setup. Next, you launch an SSH Tunnel from your system to ours:

  1. Open a command prompt on your PC (Start>Run> type CMD).
  2. In the CMD prompt execute the following command:
    plink.exe -ssh -l FTPUSER -pw FTPPASSWORD -L 3307:127.0.0.1:3306 -batch webX.3essentials.com -N
    -replace FTPUSER with your ftp username
    -replace FTPPASSWORD with your ftp password
    -replace webX with your server (web8, web10, web12, etc... )
    -Make sure to type this whole command on one line (it can wrap, just don't hit until you have the whole command in).
    -NOTE: The -l is a lower case "L"
  3. You should receive a successful connection message.
    Note: Leave the command window open, do not close the window. plink must be running and connected while you are using the connection.

Assuming you have the successful connection message, you have successfully created the tunnel. The tunnel redirects traffic like this: any traffic to your system (127.0.0.1 is a universal identifier for "the local system") on port 3307 will be redirected to our system (where the db server is) on port 3306. So, in essence:

127.0.0.7:3307 forwards to webX.3essentials.com:3306

So, now when you open your MySQL front end utility, and you are configuring a connection to the database, you will simply specify the server address as 127.0.0.1, and the port as 3307. When you launch the connection, the tunnel should pick it up on your system, and forward it across the tunnel (wrapped up in SSH packets) to our server, which will unwrap it, and deliver it to the MySQL server (the response flows back the same way).

We specify to use 3307 on your side of the connection because we assume you have MySQL installed on your system for testing purposes, and it will already be using port 3306. Technically, instead of 3307, you could use ANY TCP port that is not currently being used on your system. Typically 3307 isn't being used, so we use that, it's so close to 3306 (the standard MySQL TCP port) that you can easily remember it's for your tunneled MySQL connection.

Using SSH from a Linux box:

ssh -l FTPUSER -L 3307:127.0.0.1:3306 webXX.3essentials.com -N
This will prompt for password. Use FTP password to login.

 

Please contact support if you need further assistance.
 
Downloads Associated With This Article
plink.zip : Plink SSH tunnel client