mysql proxy socks

后端 未结 3 394
暗喜
暗喜 2020-12-11 05:15

Plain and simple, can anyone explain me how to connect to a mysql server through a proxy (socks4/5). Preferable via the mysql command line (although there are no options fo

相关标签:
3条回答
  • 2020-12-11 05:43

    All you need is to install and configure tsocks (transparent socks). It's available in most if not all linux distibutions. Afterwards you only need to prefix your command with 'tsocks', for example: tsocks mysql -h -P .....

    0 讨论(0)
  • 2020-12-11 05:47

    To my knowledge, it can't be done through the command line because the mysql command does not support proxy connections.

    If both client and server are on a UNIX machine and one of them is accessible from the outside, I suggest using an SSH tunnel. It's basically a securely tunneled TCP connection that can be used for anything and the local mysql command can connect to the tunnel port easily.

    If that's no option, you could write some kind of wrapper executable. For example, Java and Ruby have libraries that enable you to talk to SOCKS proxies and hook those sockets up to a MySQL or JDBC protocol implementation. What happens then depends entirely on what you have planned next.

    0 讨论(0)
  • 2020-12-11 05:49

    If you've got admin access to the proxy server would there be much mileage in installing MySQL Proxy on it?

    0 讨论(0)
提交回复
热议问题