Trong khi cố gắng kết nối từ xa SQL Server:Không thể kết nối: Adaptive Server không có sẵn hoặc không tồn tại
$tsql -S localhost -U myuser
tôi đã nhận lỗi như:
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
Kết quả của $tsql -C
là như sau:
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
Tôi đã tạo đường hầm cho máy chủ từ xa như:
$ssh -L 1433:db_server:1433 [email protected]_server
Chuyển tiếp cổng cục bộ 1433 tới db_server. Tôi đã thử nghiệm. Đường hầm ssh của tôi hoạt động vì tôi có thể kết nối với cơ sở dữ liệu bằng Navicat (localhost on 1433). Tôi có thể telnet localhost trên cổng 1433.
http://stackoverflow.com/a/26229487/2083490 –