通过ssh隧道检查mysql docker容器
我有一个在远程主机上运行Mysql的Docker容器。 我想通过从本地主机的SSH隧道检查Mysql数据库与Phpmyadmin。 容器在docker0桥内,地址为172.17.0.2,在端口3306上侦听。
我尝试了很多次,没有成功。
$cfg['Servers'][$i]['host'] = '127.0.0.1'; $cfg['Servers'][$i]['port'] = '3333'; $cfg['Servers'][$i]['connect_type'] = 'tcp'; $cfg['Servers'][$i]['compress'] = false; $cfg['Servers'][$i]['AllowNoPassword'] = false;
这是一个双ssh隧道的尝试:
ssh -t -t -L3333:localhost:10000 remotehostip 'ssh -L10000:172.17.0.2:3306 localhost'
Phpmyadminconfiguration:
我做错了什么? 我不想公开Mysql端口。
感谢您的答案!