- 19-02-2020 04:11
Before you can connect to an SSH Tunnel you need to have SSH enabled on your account. If youâ™re unsure, log in to https://members.panthur.com.au/mytickets/ and submit a support ticket for SSH access to be enabled on for the specific cPanel account.
Also make sure you have your cPanel login details as these will be used to SSH into your server.
Depending on your MySQL client, this may be available from the configuration options for the software. Once such program for Mac is Sequel Pro.
If your MySQL client does not provide this functionality you can establish the SSH tunnel manually using the steps below.
1. First we need to open the Terminal. Click on Go > Utilities
Then, find and click on the Terminal App
2. In the Terminal, run the following command: ssh cpanelusername@hostip -Llocalport:127.0.0.1:3306
cpanelusername your cpanel account username
hostip the IP address of your server
:22 The SSH Port
localport a random port number (1211 is safe as itâ™s not a standard port)
Now that youâ™re connected via SSH, you can test the tunneled connection by open a new terminal using command + t then run the following command: telnet 127.0.0.1 localport
Configure your software or application to connect to the MySQL server at: 127.0.0.1 and localport
Thatâ™s it! Youâ™ve now got an SSH tunnel into MySQL. If you are using Windows, please refer to our separate guide which is available here.