Ruby, connect to sql server

186 views Asked by At

I'm trying to connect to a SQL server in a domain, but I don't know why I have an error.

My environnement is Ubuntu 14.04, and I use mysql2. I think my problem is :server="myServer" but I have to specify what server.

My request is :

db = Mysql2::Client.new(:host => "xxx.xxx.xxx.xxx",:server="myServer" ,:username => "myname", :password => "SECRET", :port => 3306, :database => "test" )

which gives me this error: Mysql2::error (111)

This request is working:

db = Mysql2::Client.new(:host => "192.168.1.1", :username => "root", :password => "SECRET", :port => 3306, :database => "test" )
1

There are 1 answers

1
Josué Lima On

Take a look at this: Can't connect to MySQL server error 111

Probably you are facing the same issue.