# How to set up a secure remote MySQL connection

> Connect to your MySQL database remotely and securely using SSH tunnelling with MySQL Workbench or HeidiSQL.

Source: https://www.kualo.com/knowledgebase/cpanel-databases/how-to-setup-a-secure-remote-mysql-connection
Updated: 2026-06-09

---

Direct remote MySQL connections are disabled on Kualo's shared servers to maintain PCI compliance and improve security. You can still access your databases remotely by using SSH tunnelling, which routes the connection securely through your SSH session.

:::info
SSH access must be enabled on your account before you can follow these steps. If you are not sure whether it is enabled, [contact us](https://www.kualo.com/company/contact) and we can check for you.
:::

Two free tools that support SSH tunnelling are [MySQL Workbench](https://www.mysql.com/products/workbench/) and [HeidiSQL](https://www.heidisql.com/). Both are covered below.

## MySQL Workbench

### Step 1 - create a new connection

Open MySQL Workbench and click the **+** icon to add a new connection.

![MySQL Workbench new connection button](https://kb-cdn.kualo.com/23/6d/236d472e6c3b16b96fb2f0ba0d53255d0e0ec65f.png)

### Step 2 - fill in the connection details

Complete the fields as follows:

| Field | Value |
|---|---|
| Connection method | Standard TCP/IP over SSH |
| SSH hostname | Your server hostname and SSH port, e.g. `server.hostname.com:22` |
| SSH username | Your cPanel username |
| SSH password | Click **Store in Vault...** and enter your cPanel password |
| MySQL hostname | `localhost` |
| MySQL server port | `3306` |
| Username | Your database username |
| Password | Click **Store in Vault...** and enter your database password |

![MySQL Workbench connection settings form](https://kb-cdn.kualo.com/11/3b/113b9e0160497655e12073489368241dec10a628.png)

### Step 3 - test and connect

Click **Test Connection**. If all the details are correct, you will see a success message.

![MySQL Workbench successful connection message](https://kb-cdn.kualo.com/59/fd/59fdf2bffe076432d86df60f7029f5a8a37c7ecc.png)

You can then open the database by clicking its shortcut and selecting **Connect**.

![MySQL Workbench connection shortcut](https://kb-cdn.kualo.com/a3/dd/a3dd1aab597e1d6bd059ae52cb6eff11185aac4c.png)

## HeidiSQL

### Step 1 - create a new session

Open HeidiSQL and click **New** in the bottom-left corner to create a new connection session.

![HeidiSQL session manager](https://kb-cdn.kualo.com/4b/df/4bdf2f624e6829d313ea30316eba77f8292fca33.png)

### Step 2 - fill in the Settings tab

On the **Settings** tab, complete the fields as follows:

| Field | Value |
|---|---|
| Network type | MySQL (SSH tunnel) |
| Hostname / IP | `localhost` |
| User | Your database username |
| Password | Your database password |
| Port | `3306` |

![HeidiSQL Settings tab](https://kb-cdn.kualo.com/20/d9/20d9a8475c29aea29048c43c6a849a1d2fee9d4f.png)

### Step 3 - fill in the SSH tunnel tab

Switch to the **SSH tunnel** tab and complete the fields as follows:

| Field | Value |
|---|---|
| plink.exe location | Download plink.exe and browse to its location |
| SSH host + port | Your server hostname and SSH port |
| Username | Your cPanel username |
| Password | Your cPanel password |
| Local port | `3307` or another unused port on your computer |

![HeidiSQL SSH tunnel tab](https://kb-cdn.kualo.com/5b/41/5b419987d1b9d81f8e3204f56bac23ad8d4217ba.png)

:::info
plink.exe is part of the [PuTTY](https://www.putty.org/) suite of tools and can be downloaded from the PuTTY website.
:::

### Step 4 - save and connect

Click **Save**, then **Open** to connect.

HeidiSQL may prompt you to cache the server's host key in the registry. Click **Yes** to continue.

If all the details are correct, you will be connected to your database.

![HeidiSQL connected database view](https://kb-cdn.kualo.com/66/da/66da17433ae1e42e822629b3b2cedf8c491c482a.png)

If you need any further help, please [contact us](https://www.kualo.com/company/contact).

---

_Source: Kualo Knowledgebase — https://www.kualo.com/knowledgebase/cpanel-databases/how-to-setup-a-secure-remote-mysql-connection · © Kualo Ltd._
