我可以使用GUI工具SSH到MySQL吗? [英] Can I SSH to MySQL with the GUI tools?

查看:135
本文介绍了我可以使用GUI工具SSH到MySQL吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个ubuntu服务器,仅将其锁定为HTTP,HTTPS和SSH(端口30000).在此框上,我有一个MySQL服务器,其99.9%的时间仅在本地使用.我不时要使用GUI工具连接到MySQL实例,但又不要碰防火墙.

I have a ubuntu server which I've locked down to only HTTP, HTTPS and SSH (port 30000). On this box I have a MySQL server which 99.9% of the time is only used locally. Every now and then I want to connect to the MySQL instance with the GUI tools, but without touching the firewall.

因此,可以进行设置,以便我可以通过SSH连接连接到MySQL.我能做些什么端口转发魔术吗?

Therefore, it is possible to set things up so that I can connect to the MySQL box with the SSH connection? Is there any sort of port forwarding magic I can do?

推荐答案

ssh -L localport:127.0.0.1:remoteport user@remotehost

其中,localport是本地系统上的未绑定端口,remoteport是MySQL侦听的端口,127.0.0.1是远程系统上的回送地址,user是用户名,remotehost是远程系统的地址.

where localport is an unbound port on your local system, remoteport is the port on which MySQL listens, 127.0.0.1 is the loopback address on your remote system, user is your user name and remotehost is the address of the remote system.

然后将您的MySQL客户端指向127.0.0.1:localport.连接将通过SSH隧道转发到远程端口.

Then point your MySQL client to 127.0.0.1:localport. The connection will be forwarded over the SSH tunnel to the remote port.

这篇关于我可以使用GUI工具SSH到MySQL吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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