且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

无法通过SSH使用Workbench连接到Digitalocean上的mysql

更新时间:2023-01-30 21:56:17

这样解决了.

原来,这是一个ssh级别的问题.数字海洋服务器不支持错误中提到的Kex算法,可以通过以下操作来解决此问题.

Turns out this is an ssh level issue. The digital ocean server doesn't have the support for the Kex algorithm as mentioned in the error the following can be done to fix this.

需要在数字海洋服务器本身上完成以下步骤

Following steps needs to be done on the digital ocean server itself

1-将以下行添加到数字海洋服务器上的该文件

1- Add the following lines to this file on the digital ocean server

$ sudo vim/etc/ssh/sshd_config

$ sudo vim /etc/ssh/sshd_config

Ciphers aes256-gcm@openssh.com,aes128-gcm@openssh.com,aes256-ctr,aes128-ctr
MACs hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-512,hmac-sha2-256,hmac-ripemd160,hmac-sha1
KexAlgorithms diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha1,diffie-hellman-group-exchange-sha1

2-重新启动服务器上的ssh服务

2- Restart the ssh service on the server

$ sudo服务ssh重新启动

$ sudo service ssh restart

现在尝试再次连接mysql workbench,您应该看到该错误消失了.如果不成功,请检查日志中是否有更多错误,但这对我有用.

Now try connecting with mysql workbench again you should see that error gone. Check the logs for more errors if not successful but this did the trick for me.