尝试从tsql连接到sql-azure时,从服务器读取失败

时间:2022-03-10 03:55:26

I'm trying to connect to SQL-Azure from Ubuntu 12.04.

我正在尝试从Ubuntu 12.04连接到SQL-Azure。

I've compiled freeTds-0.91 with openssl and libiconf

我用openssl和libiconf编译了freeTds-0.91。

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

I try 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:

我tsql - c输出:

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't seem to find any information on what is causing and how to resolve this issue.

我似乎找不到任何有关原因和如何解决这个问题的信息。

Any help will be much appreaciated.

任何帮助都是值得感激的。

4 个解决方案

#1


14  

The error is caused by the use of the wrong version of TDS.

错误是由于使用了错误的TDS版本造成的。

To resolve just specify the TDS version before the tsql command:

要解决这个问题,只需在tsql命令之前指定TDS版本:

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

#2


2  

in freetds.conf

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

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

$tsql -S servername -U username 
password

#3


1  

Is your IP address whitelisted by the database server? If not, you won't be able to connect.

您的IP地址是否被数据库服务器白化?如果没有,你将无法连接。

#4


0  

Do with TDS 8.0 version worked for me.

tds8.0版本对我来说是有用的。

Just put in /etc/freetds/freetds.conf to stay permanent

把在/etc/freetds/freetds.参看保持永久

#1


14  

The error is caused by the use of the wrong version of TDS.

错误是由于使用了错误的TDS版本造成的。

To resolve just specify the TDS version before the tsql command:

要解决这个问题,只需在tsql命令之前指定TDS版本:

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

#2


2  

in freetds.conf

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

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

$tsql -S servername -U username 
password

#3


1  

Is your IP address whitelisted by the database server? If not, you won't be able to connect.

您的IP地址是否被数据库服务器白化?如果没有,你将无法连接。

#4


0  

Do with TDS 8.0 version worked for me.

tds8.0版本对我来说是有用的。

Just put in /etc/freetds/freetds.conf to stay permanent

把在/etc/freetds/freetds.参看保持永久