我正尝试使用ruby 2.2.3上的tiny-tds gem连接到Azure SQL数据库。我安装了freetds-dev
和freetds-bin
,一切似乎都很好。TinyTds无法在Debian上连接到天蓝色
tsql -C
Compile-time settings (established with the "configure" script)
Version: freetds v0.91
freetds.conf directory: /etc/freetds
MS db-lib source compatibility: no
Sybase binary compatibility: yes
Thread safety: yes
iconv library: yes
TDS version: 4.2
iODBC: no
unixodbc: yes
SSPI "trusted" logins: no
Kerberos: yes
,做
TDSVER=7.1 tsql -U xxxxx -P xxxxx -H mydatabase.database.windows.net -p 1433
连接就好了(我得到一个提示)。
我安装tiny_tds宝石:
/home/avril14th/.rvm/gems/ruby-2.2.3/gems/tiny_tds-0.7.0
,并试图连接
[email protected]:~/src/white2$ pry
[1] pry(main)> require 'tiny_tds'
=> true
[2] pry(main)> client = TinyTds::Client.new username: 'xxxx', password: 'xxxxx', host: 'xxxxx.database.windows.net', :azure => true
TinyTds::Error: Adaptive Server connection failed
我已经尝试了很多其他参数的组合,如在tiny_tds github page描述并没有奏效。
任何帮助表示赞赏。我一直在尝试超过5个小时的时间......让我感到困惑的是,它总是会立即失败,所以它不是超时问题。
那么,就像上面显示的那样,我在'tsql -C'中没有'OpenSSL:yes',但是我用TinyTds连接到Azure就好了。怎么会这样? – muichkine
@muichkine - 你现在能够连接到你的数据库吗? –
@AndreaLam是的。我在github(1.0.0.beta1)上使用了TinyTds的gem master,而不是最新发布的版本(0.7)。 – muichkine