How to set up SSH connection from remote database cluster to MySQL workbench

I have a MySQL database cluster set up that I can connect to successfully via the command line (by running the flags in the terminal).

I’d like to be able to connect to the MySQL Workbench. I looked at this tutorial but I must be missing some kind of prerequisite that I cannot figure out.

I entered: SSH Hostname: SSH Username: doadmin SSH Password: redactedPassword MySQL Hostname: MySQL Server Port: 3306 Username: root

The error I get is:

Failed to Connect to MySQL at through SSH tunnel at with user root Cannot open SSH Tunnel: Socket error: Connection reset by peer

I’ve been working on this issue for quite a long time trying to open an SSH tunnel manually in the terminal, using this template for the command: ssh -L 8888:

This command gives me: “Permission denied (publickey)”

I also generated an SSH Key file and have linked that in the Workbench but that has not helped me make progress.

This article most common causes of,%2C DenyHosts%2C etc.) may be useful in troubleshooting the specific error I am receiving from the workbench.

Is this an issue from Digital Ocean rejecting the connection? Do I need to set up some SSH tunnel manually? Why is it refusing connection?

Much appreciated.

Show comments

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Bobby Iliev
Site Moderator
Site Moderator badge
March 1, 2021
Accepted Answer

Hi there,

The tutorial with the remote MySQL connection via SSH would not work for Managed MySQL Clusters as the clusters do not come with SSH access.

The tutorial would work if you had MySQL installed on a regular Droplet.

What you could do instead is to specify the MySQL Cluster details as usual without using the SSH tunnel option in your SQL client.

Let me know if you have any questions. Regards, Bobby

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Featured on Community

Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.

Become a contributor

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow — whether you're running one virtual machine or ten thousand.

Learn more
DigitalOcean Cloud Control Panel