リモート 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 に転送されます。テストしました。Navicat (1433 のローカルホスト) を使用してデータベースに接続できるため、ssh トンネルは機能します。ポート 1433 で localhost に telnet できます。