arr*_*ero 6 mysql mysql-workbench ssh-tunnel
I have a server which I can only access via SSH, I have installed MySQL on this server. And created a remote user so I could develop using mySQL workbench, but when try to SSH using MySQL workbench GUI I get the following error: Could not connect the SSH tunnel Authentication that can continue public key.
I'm able to connect to the user from the server itself and that works without any problems, I've checked the privileges and remote access seems to be activated for this user:
+------------------+-----------+
| user | host |
+------------------+-----------+
| developer | % |
| mysql.infoschema | localhost |
| mysql.session | localhost |
| mysql.sys | localhost |
| root | localhost |
+------------------+-----------+
Run Code Online (Sandbox Code Playgroud)
I've filled in the following:
SSH Hostname <server-IP>
SSH username root
SSH password <clear>
SSH Key File <privat key file>
MySQL Hostname 127.0.0.1
MySQL Server Port 3306
Username <user>
Password <password>
Default Schema <empty>
Run Code Online (Sandbox Code Playgroud)
Dar*_*lli 28
对于那些像我一样尝试通过 PuTTY 生成的 SSH 密钥进行连接的人:
小智 15
我在连接到 MySQL 时遇到了类似的问题,我想分享我的解决方案,以防其他人在这里结束。
该问题发生在两种不同的情况下。
场景一:我使用服务器生成的私钥成功访问了 MySQL 数据库(我使用的是 CPanel)。我从我的服务器中删除了相应的公钥(错误地)然后尝试重新连接并收到错误。
这里的解决方案当然是重新生成密钥。
场景二:我尝试使用 OpenSSH 生成的私钥访问 MySQL 数据库。我将密钥的位置设置为 C:/Users/username/.ssh/id_rsa 并收到错误消息。
这里的解决方案是将 OpenSSH 私钥转换为 RSA 私钥。
ssh-keygen -p -m PEM -f C:/Users/username/.ssh/id_rsa
Run Code Online (Sandbox Code Playgroud)
确保事先备份您的 OpenSSH 私钥,因为这会覆盖 id_rsa。
然后我就可以使用 RSA 私钥连接到 MySQL 服务器。
您可以通过在任何文本编辑器中查看并阅读第一行来区分这两种类型的键。它会说 OPENSSH 或 RSA。
小智 9
对我来说,实际上反之亦然 - 我的密钥是 RSA 私钥,必须将其转换为 OpenSSH。然后MySQL Workbench连接成功。我想无论是谁遇到类似的问题,尝试以任何一种方式转换私钥都可能是值得的。
| 归档时间: |
|
| 查看次数: |
6956 次 |
| 最近记录: |