Thanks, I'll try this way, but would be better if exist some another solution with sequel gem, as it is more usefull I think.
On Jan 17, 7:42 pm, rohit <[email protected]> wrote: > On Jan 17, 3:11 am, Boris <[email protected]> wrote: > > > > > > > > > > > Hi all! > > I have a little question regarding Sequel gem. > > My issue description: > > I need to connect to multiple remote databases (e.g. mysql) from my > > rails app, but data should be transferred encrypted. I'm trying to use > > ssh tunnel for this the following way: > > > gateway = Net::SSH::Gateway.new('X.X.X.X', 'user', :password => > > "***************") > > puts "true" if gateway.active? > > my_port = gateway.open('127.0.0.1', 3306) > > my_port = 3306 > > db = Sequel.connect("mysql2:// > > root:<mysql_root_password>@127.0.0.1:#{my_port}/root_flo") > > > It seems ssh tunnel successfully created but when after this line: > > db = Sequel.connect("mysql2:// > > root:<mysql_root_password>@127.0.0.1:#{my_port}/root_flo") > > I'm trying to select some data from database, like this: > > conditions = db.from(:additionals) > > @conditions = conditions.all > > program just hangs. > > However if I'm trying to connect database directly without using ssh > > tunnel it works fine. > > Hope for your help. > > > Thanks in advance. > > Boris, > > Might be related to > thishttp://stackoverflow.com/questions/4404214/cannot-connect-to-remote-d... -- You received this message because you are subscribed to the Google Groups "sequel-talk" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/sequel-talk?hl=en.
