标签:隧道 MySQL 192.168 ssh mysql 2.22 跳板
通过ssh跳板机,连接远端mysql
本机:192.168.0.59
跳板机:121.212.2.22
mysql服务器:192.168.1.23(公网服务器的内网网卡IP,跟跳板机内网相连)
[root@localhost ~]# ssh -p 62222 -N -f -L 61001:192.168.1.231:3306 yuejianyuan@121.212.2.22
说明:
-p: yuejianyuan@121.212.2.22的ssh端口
-N: 不执行远程命令 (该参数在只打开转发端口时很有用)
-f: 一旦SSH完成认证并建立port forwarding,则转入后台运行
-L: 地址
最后接跳板机
[root@localhost ~]# mysql -h 127.0.0.1 -uusername -p -P61001
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 40548
Server version: 5.6.34-log MySQL Community Server (GPL)
Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
---------------end
标签:隧道,MySQL,192.168,ssh,mysql,2.22,跳板 来源: https://blog.csdn.net/oToyix/article/details/116055719
本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享; 2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关; 3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关; 4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除; 5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。