Forums » Beta

Thread: data/schema compare over ssh


Permlink Replies: 13 - Pages: 1 - Last Post: Oct 20, 2011 1:45 AM by: Priet Threads: [ Previous | Next ]
xzentorxz
data/schema compare over ssh
Posted: Jan 31, 2010 7:16 AM
  Click to reply to this thread Reply

Hi,

That is a great and powerfull software. I like it so far, but one thing is bugging me:

Is there any way to compare one local database with one that needs to be connected over ssh ?

If I try a direct compare it says "can't connect to mysql" or Mysql login failed. I also can't do a Snapshot (on schema compare) of an database over ssh.

Xzen






Dwight


Posts: 68
Registered: 8/22/07
RE: data/schema compare over SSH
Posted: Feb 1, 2010 12:56 PM   in response to: xzentorxz
  Click to reply to this thread Reply

Xzen,
Since SSH is using the localhost:3306 port to tunnel to the remote host, I believe that comparing a local instance of MySQL to a remote instance over SSH is possible only if you change the port of one of the instances.

Local Remote
3306 => 3306

Local Local
3307 => 3307

Otherwise, SSH and MySQL are going to collide over use of port 3306. Does that make sense?


Dwight




xzentorxz
Re: data/schema compare over SSH
Posted: Feb 2, 2010 1:23 AM   in response to: Dwight
  Click to reply to this thread Reply

Hi,

Thanks for the tip, I changed the local port to 3007, but it looks like the problem is somewhere else. I can connect over ssh to my remote database (with connection manager). If I go to Tools -> Compare -> Schema, a dialog pops up with "New Compare". There I can't connect to the ssh server (If I press DropDown for Database Selection it Says: "Can't connect to MySQL server on 'localhost'(100061) Devart.Data.MySql"). The same happens on Data Compare and it does not matter if Source or Target.

Xzen




Dwight


Posts: 68
Registered: 8/22/07
RE: Re: data/schema compare over SSH
Posted: Feb 2, 2010 10:08 AM   in response to: xzentorxz
  Click to reply to this thread Reply

Xzen,

Hmmm. I don't think that's suppose to work that way. Let me talk with the folks that work on the schema and data compare. I'll run some tests of my own, and see if I can connect. I'll get back to you with what I find.


Dwight




Dwight


Posts: 68
Registered: 8/22/07
Re: data/schema compare over SSH
Posted: Mar 1, 2010 1:10 PM   in response to: xzentorxz
  Click to reply to this thread Reply

Xzen,

I'm still working on this. Thank you for your patience.


Dwight


codeamatic

Posts: 1
Registered: 3/14/10
Re: data/schema compare over SSH
Posted: Mar 14, 2010 1:13 PM   in response to: Dwight
  Click to reply to this thread Reply

I am also experiencing the same problem. Any word yet?


Yehuda Katz
Re: Re: data/schema compare over SSH
Posted: Mar 14, 2010 1:40 PM   in response to: codeamatic
  Click to reply to this thread Reply






Mike The KID


Posts: 14
Registered: 6/11/10
Re: data/schema compare over SSH
Posted: Jun 28, 2010 2:15 PM   in response to: Dwight
  Click to reply to this thread Reply

Has there been any developments on this topic? I'm trying to do the same thing.

I don't even have to do it over SSH, SSH was just the easiest connection type for me to under stand since I already use SSH to terminal into the server. If you can instruct me how to use a different connection type, I'll try the schema compare that way. My computer is windows and my server debian.



dbenjami
Re: data/schema compare over SSH
Posted: Jun 29, 2010 8:14 AM   in response to: Mike The KID
  Click to reply to this thread Reply








I do this all the time using a tunnel with a port forwarding. I assign a different port locally (like 3307) and the actual port remote (3306). This way I connect locally to 3307 and get the system remotely.

Check out http://www.ssh.com/support/documentation/online/ssh/adminguide/32/Port_Forwarding.html for directions on this. If you're on windows, you can use cygwin to set the forwarding, and are other tools you can use if preferred.

-dale




Mike The KID


Posts: 14
Registered: 6/11/10
Re: data/schema compare over SSH
Posted: Jul 14, 2010 4:01 PM   in response to: dbenjami
  Click to reply to this thread Reply

What do you mean "This way I connect locally to 3307 and get the system remotely." Are you changing the mysql listening port on the server from 3306 to 3307?



dbenjami
Re: data/schema compare over SSH
Posted: Jul 15, 2010 8:03 AM   in response to: Mike The KID
  Click to reply to this thread Reply

On the local machine (client) I use 3307 and create ssh tunnel to redirect to port 3306 on server. The article link I referenced goes into greater detail on this technique.
-dale




Mike The KID


Posts: 14
Registered: 6/11/10
Re: data/schema compare over SSH
Posted: Jul 15, 2010 10:46 AM   in response to: dbenjami
  Click to reply to this thread Reply

I tried investigating your link but it seems like they're restructured their site and the link isn't valid anymore. I poked around a little but still didn't find much. Maybe if you wouldn't mind explaining the scenario a little more I'm sure I can figure it out.

This is what I understand so far

Use an ssh client such as Putty, and open ssh connection with tunneling.

Connect Toad, through the SSH connection manager

Because toad is using port 3306 for it's ssh connection, that is why it is necessary to have putty create a tunnel on a different port, such as 3307? Which I could still have putty connect on 3307 but the server would port forward back to 3306?

Am I understanding this correctly?



Mike The KID


Posts: 14
Registered: 6/11/10
Re: data/schema compare over SSH
Posted: Jul 15, 2010 11:27 AM   in response to: Mike The KID
  Click to reply to this thread Reply

SUCCESS!

I found this link that helped me finally be able to use the compare tool. I only wish that google would have directed me to this website sooner!

http://thelowedown.wordpress.com/2008/08/29/ssh-tunnels-how-shell-access-trumps-security/



Priet

Posts: 1
Registered: 10/20/11
Re: data/schema compare over ssh
Posted: Oct 20, 2011 1:45 AM   in response to: xzentorxz
  Click to reply to this thread Reply

Sorry to bump this old topic, but the problem seems still to be there.

I've setup a new connection with SSH as connection type. This works fine: I can view all tables and modify data. The following configuration is used:

Connection type: SSH
Host: localhost
User: root
Password: xxx
Database:
Port: 3306
SSH Port: 22
SSH Host: remote.server.com
SSH User: myname
SSH Password: yyy

However, the compare tool doesn't seem to use these SSH configuration. It tries to connect on user@localhost in stead of using the SSH tunnel (myname@remote.server.com). The result is, obviously, a time out error as I don't run a MySQL server on localhost (my workstation).

A workaround is to setup a SSH tunnel in something like Putty. This works for now, but is off course inconvenient.

I think it's save to say this is a bug? Any help in this would be highly appreciated!



Legend
Guru: 2001 + pts
Expert: 751 - 2000 pts
Enthusiast: 31 - 750 pts
Novice: 0 - 30 pts
Moderators
Helpful answer (5 pts)
Answered (10 pts)

Point your RSS reader here for a feed of the latest messages in all forums