Hello, I have added my public key to the security menu. I can connect to my droplets via SSH, but I can’t connect MySQL to Workbench. How to connect MySQL to the workbench? Thank you

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!
Heya @hilmihidayat,
By default connections to port 3306 or whatever you are using for MySQL are blocked, adding your public key to your ~/.ssh/auhtorized_keys file won’t help with that.
First SSH to your Droplet, allow your local’s IP address wheter on port 3306 or on the Whole Droplet. For instance, if we want to allow the IP 10.10.10.10 we use the command as,
ufw allow from 10.10.10.10 to any port 3306
Once that is done you should be able to connect to MySQL, using a MySQL user and password
Hey!
If your SSH key is in a newer format not recognized by MySQL Workbench, you may need to convert it to an RSA key in PEM format or ensure you’re using the latest version of MySQL Workbench, as newer versions might have better support for various SSH key formats and authentication methods.
Can you confirm the version of MySQL Workbench that you are using and the SSH key format that you have?
Besides the unsupported authentication error, usually, the setup should be the following:
127.0.0.1 (assuming MySQL is running on the same server as the SSH service).3306.Let me know how it goes!
Best,
Bobby
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.