我无法通过SSH从MySQL客户端Workbench建立数据库连接。如果我单击“测试连接”,则会在第一步中收到错误:ERROR local variable 'chan' referenced before assignment
但是我能够通过SSH通过命令行从MySQL服务器连接。我还能够使用Workbench连接到我的本地数据库。我正在使用Ubuntu和KDE 14.10,问题始于更新,所以我想它与此有关,但我不知道如何。如果您想了解更多信息,请与我们联系。
提前谢谢你,
PS我没有解决方案here就看到了类似的问题。
答案 0 :(得分:10)
这是在Debian / Ubuntu下修复此问题的解决方案:
1 首先,关闭Mysql Workbench!
2 应用补丁:
sudo cd /usr/lib/mysql-workbench/
sudo wget https://launchpadlibrarian.net/189450207/paramiko.patch
sudo patch -p1 < paramiko.patch
3 启动Mysql Workbench,它现在正在运行!
答案 1 :(得分:0)
如果您使用python 2.x,请尝试使用python3?
此错误可能与此相关:http://bugs.mysql.com/bug.php?id=74960
编辑:已确认,我已尝试使用python 2.x并将此错误输入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