Connecting to SQL-Azure with freeTDS error: Read from the server failed

Viewed 2200

I'm trying to a SQl-Azure database from ubuntu 12.04.

I've downloaded freeTDS-0.91 and compiled it with openssl and libiconf (for use with the tiny_tds gem).

When I try connect to the sql-azure db I get the following error:

martinr@martinr-DT:~/code/psg-web$ tsql -U Username -P Password -H servername.database.windows.net -p 1433
locale is "en_ZA.UTF-8"
locale charset is "UTF-8"
using default charset "UTF-8"
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

I can't seem to find anything on what is causing this error, and how to resolve it.

I can connect to instances of ms-sqlserver on a windows-server machine in the office without any problems.

Any help will be much appreciated.

2 Answers

For azure sql use protocol version 8.0 (or 7.x). You can force it by:

TDSVER=8.0 tsql -U Username@servername -P Password -H servername.database.windows.net -p 1433
Related