mysql 代理袜子

发布于 2024-07-20 20:13:01 字数 116 浏览 6 评论 0原文

简单明了,谁能解释一下如何通过代理(socks4/5)连接到mysql服务器。 最好通过 mysql 命令行(尽管客户端中没有选项)。

如果无法通过 mysql 命令行,那么任何其他方法都可以。

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 for that in the client).

If it's not possible through the mysql command line than ANY other method will work.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

べ繥欢鉨o。 2024-07-27 20:13:01

您所需要做的就是安装和配置tsocks(透明袜子)。 它在大多数(如果不是全部)Linux 发行版中都可用。 之后,您只需在命令前加上“tsocks”前缀即可,例如:
tsocks mysql -h -P .....

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 .....

挽袖吟 2024-07-27 20:13:01

据我所知,无法通过命令行完成,因为mysql命令不支持代理连接。

如果客户端和服务器都在一台 UNIX 计算机上,并且其中之一可以从外部访问,我建议使用 SSH 隧道。 它基本上是一个安全的隧道 TCP 连接,可用于任何用途,并且本地 mysql 命令可以轻松连接到隧道端口。

如果没有选择,您可以编写某种包装可执行文件。 例如,Java 和 Ruby 具有使您能够与 SOCKS 代理通信并将这些套接字连接到 MySQL 或 JDBC 协议实现的库。 接下来会发生什么完全取决于你接下来的计划。

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.

作死小能手 2024-07-27 20:13:01

如果您拥有代理服务器的管理员访问权限,那么在其上安装 MySQL 代理是否会费很大的力气?

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文