SQL-Azure connection with freeTDS error: read from server failed

I am trying to create a SQl-Azure database with ubuntu 12.04.

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

When I try to connect to 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 not find anything about what causes this error, and how to resolve it.

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

Any help would be greatly appreciated.

+6
source share
2 answers

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

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

I got it to work with this message. Be sure to follow the instructions until the part called Going The Extra Mile With Ruby 1.9.x is included if you are not using ruby ​​1.8 and are now going to use 1.9. In a later post, the author said that he leave + utf8 when running sudo port install rb-odbc + utf8, as he instructed in his first post.

You can test the connection using isql as follows:

 isql server Username Password 

For the server, enter the name that you put in brackets in the odbc.ini file.

0
source

Source: https://habr.com/ru/post/921772/


All Articles