SSH Tunnel ssh -L 12345:127.0.0.1:3306 root@my-remote-server -N my-remote-server is running mysql on localhost and you can access it in your machine even though we have'nt expose port 3306. mysql -h 127.0.0.1 -P 12345 -u myuser -p