尝试连接远程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(1433上的localhost)连接到数据库。我可以通过端口1433 telnet localhost。
答案 0 :(得分:4)
我有点修改freetds.conf
这
[global]
# TDS protocol version
; tds version = 4.2
到
[global]
# TDS protocol version
tds version = 7.0
答案 1 :(得分:1)
这适用于我在ASE 16.0上安装并运行在Ubuntu 14.04 LTS上,包括客户端和服务器。
的/ etc /主机
...
192.168.1.100 sybaseServer
...
[SYBASE]
host = 192.168.1.100
port = 5000
tds版本= 5.0
现在您可以连接到您的服务器了:
$ tsql -S SYBASE -U sa