简体   繁体   English

Ruby,连接到SQL Server

[英]Ruby, connect to sql server

I'm trying to connect to a SQL server in a domain, but I don't know why I have an error. 我正在尝试连接到域中的SQL Server,但是我不知道为什么会出错。

My environnement is Ubuntu 14.04, and I use mysql2. 我的环境是Ubuntu 14.04,我使用mysql2。 I think my problem is :server="myServer" but I have to specify what server. 我认为我的问题是:server="myServer"但我必须指定什么服务器。

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) 这给了我这个错误: Mysql2::error (111)

This request is working: 此请求正在工作:

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

Take a look at this: Can't connect to MySQL server error 111 看一看: 无法连接到MySQL服务器错误111

Probably you are facing the same issue. 可能您正面临相同的问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM