How do I access MySQL on a remote server (Ghost on Ubuntu 20.04) from my computer?

Hi! I need you to help me with this issue, please.

How do I access MySQL on a remote server (Ghost on Ubuntu 20.04 - Digital Ocean Droplet) from my computer?

I have used a MySQL application (Navicat for MySQL), and it fails to connect.

I have disabled the firewall (ufw disable), and it does not work.

I am still unable to connect.

Host: 159.203.70.136
Port: 3306
User name: root
Password: *****************

I don’t know what else to do. Please, help!!!

Thank you!

1 Like

Set firewall rules with allow to connect with port 3306.

Based on the error message it looks like there’s still a firewall issue, but this is a good thing.

If you’re trying to access a service on a remote machine, it’s better to use SSH tunneling (which is a fancy way of making a port on your server accessible on your computer) because only someone with SSH privileges can access the service, and everything is encrypted.

You probably want to create the tunnel with ssh -L 3306:127.0.0.1:3306 {user}@159.203.70.136, and then in Navicat set the host to 127.0.0.1 (localhost/loopback)

1 Like

Hi! Thank you for your replies!!

I found the solution here:

https://www.digitalocean.com/community/tutorials/how-to-allow-remote-access-to-mysql