我正在尝试使用 ruby 2.2.3 上的 tiny-tds gem 连接到 Azure SQL 数据库。我安装了freetds-dev
,freetds-bin
一切似乎都在那里工作得很好。
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 gem:
/home/avril14th/.rvm/gems/ruby-2.2.3/gems/tiny_tds-0.7.0
并尝试连接
avril14th@avril14th:~/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 页面中所述,但没有一个有效。
任何帮助表示赞赏。我已经尝试了 5 个多小时了......让我感到困惑的是,它总是立即失败,所以这不是超时的问题。