我正嘗試使用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