4

I can't establish a database connection from MySQL client Workbench through SSH. If I click Test Connection I get the error: ERROR local variable 'chan' referenced before assignment in the first step.
However I was able to connect from MySQL server through the command line, via SSH. I was also able to connect to my local database with Workbench. I am using Ubuntu with KDE 14.10 and the problem started with the update, so I guess it has to do with that, but I don't know how. Please let me know if you'd like further information. Thank you in advance,

PS I saw a similar problem without a solution here.

2
  • I'm having the same ERROR local variable 'chan' referenced before assignment problem. Commented Nov 25, 2014 at 11:27
  • MySQL bug report: bugs.mysql.com/bug.php?id=75075 Commented Dec 9, 2014 at 9:23

2 Answers 2

10

Here a solution to fix this issue under Debian/Ubuntu:

1 First, close Mysql Workbench!

2 Apply the patch:

sudo cd /usr/lib/mysql-workbench/
sudo wget https://launchpadlibrarian.net/189450207/paramiko.patch
sudo patch -p1 < paramiko.patch

3 Start Mysql Workbench, it's now working!

Sign up to request clarification or add additional context in comments.

4 Comments

Thanks for checking it out. Unfortunately I still got errors =( sudo patch -p1 < paramiko.patch patching file modules/wb_admin_ssh.py Hunk #1 FAILED at 84. Hunk #2 FAILED at 99.
Wouldn't know where to go from there, any help appreciated.
Try using the ubuntu/debian package version? Uninstall you current version and install from apt: sudo apt-get install mysql-workbench
This is helpful. I found out I had mixed the installations from source and apt-get at some point and I wasn't well aware. Going through removals and such...
0

If you use python 2.x, try using python3?

This bug is probably related: http://bugs.mysql.com/bug.php?id=74960

Edit: confirmed, I have tried with python 2.x and have this error into mysql/workbench/log/wb.log:

5:35:38 [INF][wb_admin_control.py:query_server_installation_info:767]: Currently connected to MySQL server version 'unknown', conn status = None, active plugins = []
15:35:38 [ERR][sshtunnel.py:notify_exception_error:233]: Traceback (most recent call last):
  File "/usr/share/mysql-workbench/sshtunnel.py", line 315, in accept_client
    sshchan = transport.open_channel('direct-tcpip', self._target, local_sock.getpeername())
  File "/usr/lib/mysql-workbench/modules/wb_admin_ssh.py", line 116, in wba_open_channel
    raise e
EOFError

15:35:38 [ERR][wb_admin_control.py:server_polling_thread:492]: Error creating SQL connection for monitoring: MySQLError("Lost connection to MySQL server at 'reading initial communication packet', system error: 0 (code 2013)",)
15:35:56 [INF][   base library]: Notification GNFocusChanged is not registered

1 Comment

Yes, python --version gives me Python 2.7.8. How do I set up Workbench to use Python 3?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.