First of all, port 22 is used for ssh, not mysql. In addition, its not common to run mysql visible on the internet.
But, if you do have ssh access, you can work around this, by tunneling mysql trough ssh.
In one terminal, run
ssh -L 3306:localhost:3306 example.com
where example.com is the remote ssh server. This creates a tunnel, between port 3306 locally, and on the remote end. This is encrypted and transported via ssh, so any secrets (passwords and queries) are encrypted while transported over the internet.
In another terminal, you will be able to run
mysql -h localhost --protocol=TCP -u username -p
--protocol=TCP is required, as by default mysql will connect to the socket connection on localhost, but this is unavailable, as mysql is not running locally. This connects to the ssh-tunnel set up previously.