通过Mint上的两个ssh连接在GUI中进行MySQL连接 [英] MySQL connection in GUI via two ssh connections on Mint

查看:124
本文介绍了通过Mint上的两个ssh连接在GUI中进行MySQL连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

很抱歉,如果这在某种程度上是重复的-我找不到涵盖此内容的任何内容(至少以我能理解的方式使它变得相似).

Apologies if this is in some way a duplicate - I couldn't find anything that covered this (at least in a way that I could understand made it similar).

这是我的联系的基本示意图:

Here's a basic diagram of my connections:

笔记本电脑=> SSH服务器1 => SSH服务器2 => MySQL(MariaDB)

Laptop => SSH server 1 => SSH server 2 => MySQL (MariaDB)

我可以按照常规方法使用终端跳转到服务器2:

I can use terminal to jump across to server 2 as per the usual methods:

ssh -t user@server1 ssh -p99 user@server2

然后,在终端中,我可以像往常一样mysql -uroot -p.

Then, in the terminal, I can mysql -uroot -p as normal.

(当然,已修改了连接以删除详细信息)

我尝试了几种不同的方法尝试在DBeaver中获得直接连接,但是我似乎无法使其与额外的ssh连接一起使用(在 ssh eption中-这是新功能我).我已经找到并一直在使用Gnome Connection Manager尝试实现这一目标-我习惯使用Win工具,例如Penguinet,该工具在Linux上不可用,但看起来确实能够.

I have attempted a few different things to try and get a direct connection in DBeaver, but I can't seem to make it work with that extra ssh connection (inssheption - it's new to me). I've found, and have been playing with, Gnome Connection Manager to try and make this happen - I'm used to Win tools like Penguinet, which isn't available on Linux, but it does look to be capable.

我可能还不够深入,但是我认为这应该很简单-但我无法掌握如何实现这一目标.

I'm probably just out of my depth, but I am thinking that this should be simple - but I just can't get the hang of how to get this going.

我希望在某个时候能够连接到DBeaver(SQL GUI)中的127.0.0.1:1234,但我只是在努力做到这一点.

I'm expecting that at some point I'll be able to connect to 127.0.0.1:1234 in DBeaver (SQL GUI), but I'm just struggling to make that happen.

有人有时间建议将菊花链式连接在一起的最佳方法吗?

Does anyone have a moment to advise the best method to daisy-chain the connections together?

推荐答案

使用SSH进行端口转发以将远程端口引入本地计算机.

Use port forwarding with SSH to bring remote port to your local machine.

ssh -L 1234:server1:1234 -t user@server1 ssh -L 1234:server2:1234 -p99  user@server2

现在您可以连接到localhost:1234,并且您的连接将转发到server2:1234.只要确保未使用server1和localhost上的端口1234.

Now you can connect to localhost:1234 and your connection will be forwarded to server2:1234. Just make sure that port 1234 on server1 and localhost are not in use.

这篇关于通过Mint上的两个ssh连接在GUI中进行MySQL连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆