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

问题描述:

我已经使用laravel应用程序和数据库设置了我的液滴.在腻子ssh上创建了我的数据库.现在,当我尝试以镜像方式连接到我的mysql数据库时,出现错误.

I have got my droplet set with the laravel app and database. Created my db while on putty ssh. Now when I am trying to connect to my mysql database as in image, i am getting error.

错误:身份验证错误,隧道管理器中捕获了未处理的异常,请查阅日志以获取详细信息.

Error: Authentication error, unhandled exception caught in tunnel manager, plese refer to logs for details.

请注意,我的凭据是正确的,因为我用来通过腻子进行连接.关于如何查看我的数据库有任何帮助吗?

Note that my credentials are right, as that what I use to connect through putty. Any help on how can I see view my database?

这样解决了.

原来,这是一个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.