Error 20002 (severity 9):Adaptive Server connection failed

环境:

Ubuntu12.10_x64

问题:

用tsql访问SQL Server
>> tsql -H 192.168.88.133 -p 1433 U sa
Error 20002 (severity 9):
Adaptive Server connection failed

解决:

查看TDS version
>> tsql -C
Compile-time settings (established with the "configure" script)
                            Version: freetds v0.91
             freetds.conf directory: /usr/local/freetds/etc
     MS db-lib source compatibility: yes
        Sybase binary compatibility: no
                      Thread safety: yes
                      iconv library: yes
                        TDS version: 7.1
                              iODBC: no
                           unixodbc: yes
              SSPI "trusted" logins: no
                           Kerberos: no
查看freetds.conf文件
>> vim /usr/local/freetds/etc/freetds.conf
添加相应的版本信息
# A typical Microsoft server
[egServer71]
        host = ntmachine.domain.com
        port = 1433
        tds version = 7.1
查看数据源文件
>> vim /etc/tds.datasource.template 

修改TDS_Version

TDS_Version          = 7.1
查看odbc.ini文件
>> vim /etc/odbc.ini
修改TDS_Version
TDS_Version          = 7.1
 
说明:
此问题的解决方法可能不止一种,LZ其实还没有弄清楚问题的根本,只是通过以上方法解决了问题。LZ会更努力,找出出现此问题的原因,以后会再更新。

转载于:https://www.cnblogs.com/lukcyjane/p/3849000.html

你可能感兴趣的:(数据库,php,开发工具)