2013-05-06 20 views
11

yok:Bağlanılamadı: Uzaktan SQL Server bağlanmaya çalışırken Adaptive Server yok veya

$tsql -S localhost -U myuser 

ben var gibi hata: $tsql -C çıktısı aşağıdaki gibidir

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 

:

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 

ben gibi uzak sunucu için tünel oluşturduk:

$ssh -L 1433:db_server:1433 [email protected]_server 

Bu, yerel bağlantı noktası 1433'ü db_server'a iletir. Test ettim. Ssh tünelim çalışır çünkü Navicat (1433'te localhost) kullanarak veritabanına bağlanabiliyorum. Ben 1433

+0

http://stackoverflow.com/a/26229487/2083490 –

cevap

4

aslındasensin Bu ASE 16.0 yüklü benim için çalıştı

[global] 
    # TDS protocol version 
tds version = 7.0 
+4

Bu benim için çalışmadı: / –

1

için

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

den

freetds.conf değiştirerek çalışmış olsun bağlantı noktasında localhost telnet Ubuntu 14.04 LTS'de hem istemci hem de sunucu üzerinde çalışıyor.

  • Sunucu: Sunucunuzun/etc/hosts dosyasında (sybaseServer) bir giriş olduğundan emin olun. Standart bir Ubuntu 14.04 kurulumunda bunu bulamazsınız, ancak "127.0.1.1 sybaseServer". Ama sibase buna bağlı gibi görünüyor.

/etc/hosts
...
192.168.1.100 sybaseServer
...

  • MÜŞTERİ: freetds.conf giriş

[Sybase olduğunu
host = 192.168.1.100
bağlantı noktası = 5000
tds version = 5.0

Artık sunucuya bağlanabilir:

$ TSQL -S Sybase U sa

  • açıkçası IP adresini değiştirmek zorunda, servername vb Kendi Verileriniz İçin: