MySQL工作台configuration:
Connection Name: TEST Connection Method: Standard TCP/IP over SSH SSH Hostname: xxxx:22 SSH Username: root SSH Password: myRootPa$$word SSH Key File: <NOT-USING-KEYFILE> MySQL Hostname: 127.0.0.1 MySQL Server Port: 3306 Username: root Password: myMySQLPa$$word
我仔细检查了IP地址/主机名,用户名和密码…
Debian Wheezy服务器configuration:
root @ debian:〜#cat / etc / debian_version
7.8
mysql> select version();
+------------------+ | version() | +------------------+ | 5.5.40-0+wheezy1 | +------------------+ 1 row in set (0.00 sec)
root @ debian:〜#cat / etc / ssh / sshd_config
Port 22 Protocol 2 HostKey /etc/ssh/ssh_host_rsa_key HostKey /etc/ssh/ssh_host_dsa_key HostKey /etc/ssh/ssh_host_ecdsa_key UsePrivilegeSeparation yes KeyRegenerationInterval 3600 ServerKeyBits 768 SyslogFacility AUTH LogLevel INFO LoginGraceTime 120 PermitRootLogin yes StrictModes yes RSAAuthentication yes PubkeyAuthentication yes IgnoreRhosts yes RhostsRSAAuthentication no HostbasedAuthentication no PermitEmptyPasswords no ChallengeResponseAuthentication no X11Forwarding yes X11DisplayOffset 10 PrintMotd no PrintLastLog yes TCPKeepAlive yes AcceptEnv LANG LC_* Subsystem sftp /usr/lib/openssh/sftp-server UsePAM yes
Debian Jessie服务器configuration:
root @ debian:〜#cat / etc / debian_version
8.0
mysql> select version();
+-----------------+ | version() | +-----------------+ | 5.5.43-0+deb8u1 | +-----------------+ 1 row in set (0.00 sec)
root @ debian:〜#cat / etc / ssh / sshd_config
Port 22 Protocol 2 HostKey /etc/ssh/ssh_host_rsa_key HostKey /etc/ssh/ssh_host_dsa_key HostKey /etc/ssh/ssh_host_ecdsa_key HostKey /etc/ssh/ssh_host_ed25519_key UsePrivilegeSeparation yes KeyRegenerationInterval 3600 ServerKeyBits 1024 SyslogFacility AUTH LogLevel INFO LoginGraceTime 120 PermitRootLogin yes StrictModes yes RSAAuthentication yes PubkeyAuthentication yes IgnoreRhosts yes RhostsRSAAuthentication no HostbasedAuthentication no PermitEmptyPasswords no ChallengeResponseAuthentication no X11Forwarding yes X11DisplayOffset 10 PrintMotd no PrintLastLog yes TCPKeepAlive yes AcceptEnv LANG LC_* Subsystem sftp /usr/lib/openssh/sftp-server UsePAM yes
所以男人的区别是两个sshd_config文件之间的ServerKeyBits …
当我尝试连接到Debian Jessie服务器时,MySQL Workbench 6.3.3出错:
Could not connect the SSH Tunnel Authentication error, unhandled exception caught in tunnel manager, please refer to logs for details
日志文件:
10:00:04 [INF][ SSH tunnel]: Starting tunnel 10:00:04 [INF][ SSH tunnel]: Existing SSH tunnel not found, opening new one 10:00:07 [INF][ SSH tunnel]: Opening SSH tunnel to 10.232.50.15:22 10:00:07 [WRN][sshtunnel.py:_connect_ssh:287]: IOError, probably caused by file C:\Users\myUser\AppData\Roaming\MySQL\Workbench\ssh\known_hosts not found, the message was: [Errno 2] No such file or directory: u'C:\\Users\\myUser\\AppData\\Roaming\\MySQL\\Workbench\\ssh\\known_hosts' 10:00:07 [ERR][sshtunnel.py:notify_exception_error:233]: Traceback (most recent call last): File "C:\Program Files\MySQL\MySQL Workbench 6.3 CE\sshtunnel.py", line 297, in _connect_ssh look_for_keys=has_key, allow_agent=has_key) File "C:\Program Files\MySQL\MySQL Workbench 6.3 CE/python/site-packages\paramiko\client.py", line 301, in connect t.start_client() File "C:\Program Files\MySQL\MySQL Workbench 6.3 CE/python/site-packages\paramiko\transport.py", line 461, in start_client raise e SSHException: Incompatible ssh peer (no acceptable kex algorithm) 10:00:07 [INF][ SSH tunnel]: TunnelManager.wait_connection authentication error: Authentication error, unhandled exception caught in tunnel manager, please refer to logs for details 10:00:07 [ERR][ SSH tunnel]: Authentication error opening SSH tunnel: Authentication error, unhandled exception caught in tunnel manager, please refer to logs for details
更多信息:
文件夹“ssh”不存在于:
C:\Users\myUser\AppData\Roaming\MySQL\Workbench
两台服务器的防火墙规则:
root@debian:~# iptables -vnL Chain INPUT (policy ACCEPT 0 packets, 0 bytes) pkts bytes target prot opt in out source destination Chain FORWARD (policy ACCEPT 0 packets, 0 bytes) pkts bytes target prot opt in out source destination Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes) pkts bytes target prot opt in out source destination
我可以在两个服务器上连接SSH(KiTTY)…
我已经尝试了两个不同版本的MySQL Workbench:
Version 6.3.3.0 build 592 (64 bits) Version 6.0.9.11421 build 1170 (32 bits)
这两个版本适用于Debian Wheezy,但不适用于Debian Jessie。 我错过了什么?
我find了解决办法。
我将这一行添加到我的/etc/ssh/sshd_config文件中:
KexAlgorithms [email protected],ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
并重新启动ssh: systemctl restart ssh
正如本文所示: https : //stackoverflow.com/questions/26577494/aptana-sftp-key-exchange
根据https://bugs.mysql.com/bug.php?id=74658 ,当使用openssh 6.7 MySql工作台附带的python库时,问题就出现了。 将“KexAlgorithms”添加到sshdconfiguration文件时,可以更新MySql Workbench附带的python库。 这可能是方便的,如果你不能控制sshdconfiguration…
如果您在错误报告中向下滚动,则有指示可下载并复制paramiko和ecdsa库。
由于有很多需要滚动bigmandan的答案,我认为这也可以在这里发布,以便更容易find。
对于Windows ,这是修复。 [2015年6月3日15:27] Mike Hadrup同时在Windows 10 64位下使用MySQL Workbench 6.3.3.0(592)msi和noinstall对Debian 8 Jessie和OpenSSH 6.7
您可以使用http://www.7-zip.org/中的7zip作为ecdsa-0.13.tar.gz gizpped tar归档文件。
注意:Windows 10上需要Visual Studio 2013的Visual C ++可再发行组件包: https : //www.microsoft.com/zh-CN/download/details.aspx?id = 40784
在OS X上 ,将paramiko和ecdsa库复制到:/Applications/MySQLWorkbench.app/Contents/Resources/libraries
因为有两种方法连接到mysql。 当你安装MySQL的时间,那时候它问你去哪里wana第一是非常服务,并给你良好的性能,第二个是TCP / IP的unix袜子,请检查特权或者你可以连接到你的数据库远程只是使用了一些其他的IP,如果没有,那么你启用了MySQL的安全function
在linux(和完全避开这个问题),我发现它更简单/清洁手动创build我自己的ssh隧道mysql-workbench使用:
ssh root @ host -L 3307:localhost:3306
这将创build一个从本地端口3307到远程本地端口3306的ssh隧道。 因此,您只需configurationmysql-workbench以连接到localhost:3307 。