MySQL Workbench and multi hop ssh tunnel
I have an issue with MySQL Workbench. This is how my connection looks like:
laptop => bastion:22 => machineX:22 (10.10.10.10) => mysql:3306
So, I have two hops before I can reach the database (three hops to the database itself). Only 'machineX' has access to that DB on port 3306.
My SSH config contains:
Host 10.10.10.10
ProxyCommand ssh -W %h:%p bastion
Using the above:
- I can successfully connect to that DB using an ssh tunnel by exposing remote port locally and connecting to localhost
- I can successfully connect to that DB using Sequel Pro on Mac (using SSH config)
BUT I can't connect using MySQL Workbench (using TCP/IP over SSH option).
Even though I specified the ssh config file in MySQL WB properties it seems like it cannot figure out how to make those two hops.
Error message:
Failed to Connect to MySQL at mysql:3306 through SSH tunnel at user@10.10.10.10 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
Either MySQL Workbench is not smart enough or there's something else that needs to be set up that I'm just not aware of? I tried both MySQL WB for Mac and Windows and no luck. As I said, it works perfectly fine using Sequel Pro for example!
Before you say - establish a tunnel and then connect on localhost - I already say NO, I don't want to do that because of reasons. I want it to work using only the SSH config within the MySQL WB.
mysql ssh-tunneling
add a comment |
I have an issue with MySQL Workbench. This is how my connection looks like:
laptop => bastion:22 => machineX:22 (10.10.10.10) => mysql:3306
So, I have two hops before I can reach the database (three hops to the database itself). Only 'machineX' has access to that DB on port 3306.
My SSH config contains:
Host 10.10.10.10
ProxyCommand ssh -W %h:%p bastion
Using the above:
- I can successfully connect to that DB using an ssh tunnel by exposing remote port locally and connecting to localhost
- I can successfully connect to that DB using Sequel Pro on Mac (using SSH config)
BUT I can't connect using MySQL Workbench (using TCP/IP over SSH option).
Even though I specified the ssh config file in MySQL WB properties it seems like it cannot figure out how to make those two hops.
Error message:
Failed to Connect to MySQL at mysql:3306 through SSH tunnel at user@10.10.10.10 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
Either MySQL Workbench is not smart enough or there's something else that needs to be set up that I'm just not aware of? I tried both MySQL WB for Mac and Windows and no luck. As I said, it works perfectly fine using Sequel Pro for example!
Before you say - establish a tunnel and then connect on localhost - I already say NO, I don't want to do that because of reasons. I want it to work using only the SSH config within the MySQL WB.
mysql ssh-tunneling
What you have a hammer all you see is nails. Might it ocurred to you this is not a good setup? Do it properly with a VPN.
– Rui F Ribeiro
Feb 7 at 11:39
add a comment |
I have an issue with MySQL Workbench. This is how my connection looks like:
laptop => bastion:22 => machineX:22 (10.10.10.10) => mysql:3306
So, I have two hops before I can reach the database (three hops to the database itself). Only 'machineX' has access to that DB on port 3306.
My SSH config contains:
Host 10.10.10.10
ProxyCommand ssh -W %h:%p bastion
Using the above:
- I can successfully connect to that DB using an ssh tunnel by exposing remote port locally and connecting to localhost
- I can successfully connect to that DB using Sequel Pro on Mac (using SSH config)
BUT I can't connect using MySQL Workbench (using TCP/IP over SSH option).
Even though I specified the ssh config file in MySQL WB properties it seems like it cannot figure out how to make those two hops.
Error message:
Failed to Connect to MySQL at mysql:3306 through SSH tunnel at user@10.10.10.10 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
Either MySQL Workbench is not smart enough or there's something else that needs to be set up that I'm just not aware of? I tried both MySQL WB for Mac and Windows and no luck. As I said, it works perfectly fine using Sequel Pro for example!
Before you say - establish a tunnel and then connect on localhost - I already say NO, I don't want to do that because of reasons. I want it to work using only the SSH config within the MySQL WB.
mysql ssh-tunneling
I have an issue with MySQL Workbench. This is how my connection looks like:
laptop => bastion:22 => machineX:22 (10.10.10.10) => mysql:3306
So, I have two hops before I can reach the database (three hops to the database itself). Only 'machineX' has access to that DB on port 3306.
My SSH config contains:
Host 10.10.10.10
ProxyCommand ssh -W %h:%p bastion
Using the above:
- I can successfully connect to that DB using an ssh tunnel by exposing remote port locally and connecting to localhost
- I can successfully connect to that DB using Sequel Pro on Mac (using SSH config)
BUT I can't connect using MySQL Workbench (using TCP/IP over SSH option).
Even though I specified the ssh config file in MySQL WB properties it seems like it cannot figure out how to make those two hops.
Error message:
Failed to Connect to MySQL at mysql:3306 through SSH tunnel at user@10.10.10.10 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
Either MySQL Workbench is not smart enough or there's something else that needs to be set up that I'm just not aware of? I tried both MySQL WB for Mac and Windows and no luck. As I said, it works perfectly fine using Sequel Pro for example!
Before you say - establish a tunnel and then connect on localhost - I already say NO, I don't want to do that because of reasons. I want it to work using only the SSH config within the MySQL WB.
mysql ssh-tunneling
mysql ssh-tunneling
asked Feb 7 at 11:14
SEBSEB
111
111
What you have a hammer all you see is nails. Might it ocurred to you this is not a good setup? Do it properly with a VPN.
– Rui F Ribeiro
Feb 7 at 11:39
add a comment |
What you have a hammer all you see is nails. Might it ocurred to you this is not a good setup? Do it properly with a VPN.
– Rui F Ribeiro
Feb 7 at 11:39
What you have a hammer all you see is nails. Might it ocurred to you this is not a good setup? Do it properly with a VPN.
– Rui F Ribeiro
Feb 7 at 11:39
What you have a hammer all you see is nails. Might it ocurred to you this is not a good setup? Do it properly with a VPN.
– Rui F Ribeiro
Feb 7 at 11:39
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "106"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f499260%2fmysql-workbench-and-multi-hop-ssh-tunnel%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f499260%2fmysql-workbench-and-multi-hop-ssh-tunnel%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
What you have a hammer all you see is nails. Might it ocurred to you this is not a good setup? Do it properly with a VPN.
– Rui F Ribeiro
Feb 7 at 11:39