MySQL – How to Connect to Remote MySQL Server Using Socks Proxy

macmac-osxMySQLPROXYUbuntu

I can only connect to a remote server from an specific IP address (Ubuntu Server), this was okay when I was at office but now that I'm working from home I'm stuck.

I have SSH access to the Ubuntu server with this specific IP address, so I connected to it using SSH Proxy (which provides local Socks 5 proxy).

So far I have found ways to connect to SSH and FTP (using FileZilla, which supports Socks Proxy)

But I have found no macOS MySQL GUI app that supports socks 5 proxy.

Please advise.

Best Answer

You can either use open-ssh local tunneling. You can use option -L in command line or LocalForward in ~/.ssh/config

ssh -L 33060:mysql_server_ip:3306

Then use localhost:33060 in MySQL clients as server:port string.

Another alternative is to use MySQL Workbench with ssh tunneling.

Related Topic