forums › forums › SQLyog › Using SQLyog › Multiple Ssh Hosts To Tunnel
- This topic is empty.
-
AuthorPosts
-
-
April 5, 2012 at 3:27 am #12632sankoMember
How do I connect to MySQL database through two SSH hosts ?
Here is my situation: I have two SSH hosts as show below. MySQL is running in BOX2 host.
MyBox(SQLYog)
SSH(port 22)—>BOX1(IP: 190.xx.xx.xx)—SSH(port 22)—>BOX2(IP: 190.xx.xx.xx)[MySQL server]I have checked with SQLYog SSH tunnel feature . I see it has one SSH Host credentials to key in.
My question is how do I connect if I have multiple SSH hosts to tunnel as shown above ?
I need your help at this part. Could you please post steps to try with ?
Yhanks
-
April 5, 2012 at 7:21 am #33246sathishMember
Hello,
Try this command from MyBox(having SQLyog)
Code:ssh user@box1 -L some-local-port:box2:22Now from SQLyog connect this way
MySQL host : localhost
MySQL usernmae : mysql-username-of-server-installed-at-Box2
MySQL password : mysql-password-of-server-installed-at-Box2
MySQL port : 3306 (suppose mysql server at Box-2 is listening at port 3306)
In SSH tab tunnelling info
SSH host : localhost
SSH pass : ssh-password-of-Box2
SSH port : some-local-port
Regards,
Sathish
-
April 5, 2012 at 7:55 am #33247peterlaursenParticipant
Let me put the question another way: how would you do that with Putty or Plink for instance? As far as I can see this will have to be handled in the SSH configuration of Box1. You/SQLyog will authenticate against Box1 and Box1 will authenticate against Box2.
(and you cannot execute 'ssh' command on WIndows unless you have Cygwin or similar installed)
-
April 5, 2012 at 8:05 am #33248peterlaursenParticipant
Atter some internal discussion the conclusion is that you cannot do this from the SQLyog connection manager. You will need to create the tunnel with an external program.
We will explain in detail shortly how you can use Putty in combination with SQLyog for this.
-
April 5, 2012 at 9:19 am #33249sathishMember
Hello,
It can be done as follows
1. Open Putty
2. In session put the credential of BOX1
3. Goto Connection -> SSH -> Tunnels in putty
- Add Source Port = 10000 (this will be a localport in your MyBox(SQLYog), you can change this port depending on availability of open port)
- Add Destination = BOX2:22
- Click on add
4. Connect
Alternatively in Linux you can use this command
Code:ssh user@BOX1 -L 10000:BOX2:22Now from SQLyog connect this way
MySQL host : localhost
MySQL usernmae : mysql username of BOX2
MySQL password : mysql password of BOX2
MySQL port : mysql port of BOX2
In SSH tab tunnelling info
SSH host : localhost
SSH pass : SSH password of BOX2
SSH port : 10000
Note : You have to keep the SSH session to be opened whenever you are using this connections.
Regards,
Sathish
-
-
AuthorPosts
- You must be logged in to reply to this topic.