MySQL Workbench 和多跳 ssh 隧道

MySQL Workbench 和多跳 ssh 隧道

我对 MySQL Workbench 有疑问。我的连接是这样的:

laptop => bastion:22 => machineX:22 (10.10.10.10) => mysql:3306

因此,在到达数据库之前我有两跳(到达数据库本身的三跳)。只有“machineX”可以通过端口 3306 访问该数据库。

我的 SSH 配置包含:

Host 10.10.10.10
  ProxyCommand ssh -W %h:%p bastion

使用上面的:

  • 我可以通过在本地公开远程端口并连接到本地主机,使用 ssh 隧道成功连接到该数据库
  • 我可以在 Mac 上使用 Sequel Pro 成功连接到该数据库(使用 SSH 配置)

但我无法使用 MySQL Workbench 进行连接(使用 TCP/IP over SSH 选项)。尽管我在 MySQL WB 属性中指定了 ssh 配置文件,但它似乎无法弄清楚如何进行这两个跃点。

错误信息:

Failed to Connect to MySQL at mysql:3306 through SSH tunnel at [email protected] with user dbuser

11:06:00 [INF][     SSH tunnel]: Existing SSH tunnel not found, opening new one
11:06:00 [INF][     SSH tunnel]: Opening SSH tunnel to 10.10.10.10
11:06:00 [DB2][sshtunnel.py:do_run:119]: SSH Tunel 17 thread started
11:06:00 [DB2][sshtunnel.py:notify:230]: tunnel_28908: INFO Connecting to SSH server at 10.10.10.10:22 using key /Users/seb/.ssh/id_rsa...
11:06:00 [DB1][     SSH tunnel]: Waiting on tunnel to connect...
11:06:00 [DB1][sshtunnel.py:wait_connection:484]: INFO: Connecting to SSH server at 10.10.10.10:22 using key /Users/seb/.ssh/id_rsa...
11:06:10 [DB2][sshtunnel.py:notify:230]: tunnel_28908: IO_ERROR IO Error: timed out.
 Please refer to logs for details.
11:06:10 [DB1][sshtunnel.py:wait_connection:492]: returning from wait_connection(28908): IO Error: timed out.
 Please refer to logs for details.
11:06:10 [DB1][     SSH tunnel]: TunnelManager.wait_connection() returned IO Error: timed out.
 Please refer to logs for details.
11:06:10 [ERR][     SSH tunnel]: TunnelManager.wait_connection got IOError: IO Error: timed out.
 Please refer to logs for details.
11:06:10 [ERR][sshtunnel.py:notify_exception_error:235]: Traceback (most recent call last):
  File "/Applications/MySQLWorkbench.app/Contents/Resources/sshtunnel.py", line 303, in _connect_ssh
    look_for_keys=has_key, allow_agent=has_key, timeout=SSH_CONNECTION_TIMEOUT)
  File "/Applications/MySQLWorkbench.app/Contents/Resources/libraries/paramiko/client.py", line 292, in connect
    retry_on_signal(lambda: sock.connect(addr))
  File "/Applications/MySQLWorkbench.app/Contents/Resources/libraries/paramiko/util.py", line 270, in retry_on_signal
    return function()
  File "/Applications/MySQLWorkbench.app/Contents/Resources/libraries/paramiko/client.py", line 292, in <lambda>
    retry_on_signal(lambda: sock.connect(addr))
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/socket.py", line 228, in meth
    return getattr(self._sock,name)(*args)
timeout: timed out

要么 MySQL Workbench 不够智能,要么还有其他需要设置但我不知道的东西?我尝试了适用于 Mac 和 Windows 的 MySQL WB,但没有成功。正如我所说,例如使用 Sequel Pro 就可以完美地工作!

在你说 - 建立隧道然后在本地主机上连接 - 我已经说不,由于原因我不想这样做。我希望它仅使用 MySQL WB 中的 SSH 配置来工作。

相关内容