Connect to MySQL remotely
Database tools such as MySQL Workbench, TablePlus, and DBeaver can connect to your hosting database from your computer. There are two ways. The SSH tunnel is safer and is the one we recommend.
Option 1: SSH tunnel (recommended)
The tunnel carries database traffic through your encrypted SSH login. You don't open MySQL to the internet.
Before you start
- SSH access works. SSH is included with Business and Pro plans. See Connect with SSH and Create and add SSH keys.
- A database and user. See Create a MySQL database and user.
From the command line
ssh -N -L 3307:127.0.0.1:3306 [email protected] -p 1988
Your hosting username and the exact command are shown under Account → Hosting → your site → Developer. Leave it running. Now connect your tool to 127.0.0.1 on port 3307.
In TablePlus, Workbench, or DBeaver
Choose Connect over SSH and fill in:
| Field | Value |
|---|---|
| SSH host | example.ca (your site's own domain) |
| SSH port | 1988 |
| SSH user | your hosting username, shown in Developer |
| SSH auth | password or key |
| MySQL host | 127.0.0.1 |
| MySQL port | 3306 |
| MySQL user | yourusername_shop |
| MySQL password | the database password |
| Database | yourusername_bakery |
Option 2: Remote access (direct)
Direct access works on every plan, including Essential. The server accepts MySQL connections on port 3306, and only from the IP addresses you add.
- Find your public IP address at a site such as
https://ifconfig.me. - Open Account → Hosting → your site → Databases.
- Under Remote access, enter your IP address in IP address or hostname. Don't use
%, which allows the whole internet. - Click Allow.
- Connect to the Host, remote value shown under Connection details, on port
3306.
Home and mobile IP addresses change, so you'll need to update the entry.
Security rules
- Allow only IPs you control.
- Use a separate user with only the privileges needed.
- Remove entries you no longer use.
- Never share your account password with a tool. Use a database user.
If something goes wrong
| Error | Fix |
|---|---|
Can't connect to MySQL server |
Tunnel isn't running, or your IP isn't allowed |
Access denied for user |
Wrong password or the user isn't attached to the database |
| Tunnel drops | Add -o ServerAliveInterval=60 to the SSH command |
Still stuck? Ask us and we'll walk you through it.
