If you are using the command line ssh, the command would look like this.

We’re using localhost as the hostname because we are directly accessing the remote mysql server through ssh.

You could also use this technique to port-forward through one ssh server to another server.

Access Your MySQL Server Remotely Over SSH