Failed to read from server while trying to connect to sql-azure from tsql

I am trying to connect to SQL-Azure from Ubuntu 12.04.

I compiled freeTds-0.91 with openssl and libiconf

tsql -H XXXXXXXX.database.windows.net -U Username -D DatabaseName -p 1433 -P Password

I try to connect using the above statement and I get this error:

locale is "en_ZA.UTF-8"
locale charset is "UTF-8"
using default charset "UTF-8"
Default database being set to DatabaseName
Error 20004 (severity 9):
    Read from the server failed
    OS error 104, "Connection reset by peer"
Error 20002 (severity 9):
    Adaptive Server connection failed
There was a problem connecting to the server

My tsql -C output is:

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

I can not find any information on what causes and how to solve this problem.

Any help would be greatly simplified.

+5
source share
4 answers

The error is caused by the wrong version of TDS.

To solve, simply specify the TDS version before the tsql command:

TDSVER=8.0 tsql -H XXXXXXXX.database.windows.net -U Username -D DatabaseName -p 1433 -P Password
+14
source
in freetds.conf

[servername] 
host = ipAddress
port = 1433
tds version = 8.0

for checking freetds connection
===============================

$tsql -S servername -U username 
password
+2
source

Is your IP address a remote database server? If not, you will not be able to connect.

+1
source

Working with TDS version 8.0 worked for me.

Just enter /etc/freetds/freetds.confto stay constant

0
source

All Articles