加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 站长学院 > MsSql教程 > 正文

sql-server – 无法连接:Adaptive Server不可用或不存在

发布时间:2020-12-12 08:38:26 所属栏目:MsSql教程 来源:网络整理
导读:尝试连接远程SQL Server时: $tsql -S localhost -U myuser 我有错误,像: locale is "en_US.UTF-8"locale charset is "UTF-8"using default charset "UTF-8"Error 20009 (severity 9): Unable to connect: Adaptive Server is unavailable or does not exist
尝试连接远程SQL Server时:
$tsql -S localhost -U myuser

我有错误,像:

locale is "en_US.UTF-8"
locale charset is "UTF-8"
using default charset "UTF-8"
Error 20009 (severity 9):
    Unable to connect: Adaptive Server is unavailable or does not exist
    OS error 61,"Connection refused"
There was a problem connecting to the server

$tsql -C的输出如下:

Compile-time settings (established with the "configure" script)
                        Version: freetds v0.91
         freetds.conf directory: /usr/local/freetds/conf/freetds
 MS db-lib source compatibility: no
    Sybase binary compatibility: no
                  Thread safety: yes
                  iconv library: no
                    TDS version: 5.0
                          iODBC: no
                       unixodbc: no
          SSPI "trusted" logins: no
                       Kerberos: no

我为远程服务器创建了隧道,如:

$ssh -L 1433:db_server:1433 user@mid_server

这将本地端口1433转发到db_server.我测试了我的ssh隧道工作,因为我可以连接到数据库使用Navicat(localhost在1433).我可以在1433端口telnet localhost.

解决方法

我有点通过修改freetds.conf来实现它

[global]
    # TDS protocol version
;   tds version = 4.2

[global]
    # TDS protocol version
tds version = 7.0

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读