问题
I try to connect to Azure database like:
tsql -H XXXXXX.database.windows.net -p 1433 -U mycorrectusername
but I got message
Msg 20004, Level 9, State 0, Server OpenClient, Line 0
Read from SQL server failed.
Msg 20014, Level 9, State 0, Server OpenClient, Line 0
Login incorrect.
There was a problem connecting to the server
It is possible that I cant login because I have to choose database first. I have to, when I log in via website.
When I try to choose database like:
tsql -H XXXXXXXXX.database.windows.net -p 1433 -U username -D databasename
but I get message:
tsql: illegal option -- D
Here is tsql configuration:
[~]$ tsql -C
Compile-time settings (established with the "configure" script):
Version: freetds v0.64
MS db-lib source compatibility: yes
Sybase binary compatibility: unknown
Thread safety: yes
iconv library: yes
TDS version: 5.0
iODBC: no
unixodbc: no
Thank you for any suggestions.
回答1:
It is not possible to connect with Azure database with FreeTDS v0.64. The solution is to compile the newest freetds version, currently 0.91. The sources are avalible here:
https://gitorious.org/freetds/freetds/source/a6898bdd6fa115447366ddbc76830e6826ea5d21:
and compile it with ms dblib source compatibility option (and tls or openssl for the encrypted connection).
来源:https://stackoverflow.com/questions/19845687/freetds-on-linux-and-azure-database-login-issue