简体   繁体   中英

can't connect to azure sql server from ubuntu

I am getting the following error when trying to access my azure sql server from terminal using the command

tsql -H 'myserver.database.windows.net' -U 'myuser' -P 'mypass'

Error:

locale is "en_US.UTF-8"
locale charset is "UTF-8"
using default charset "UTF-8"
Error 20017 (severity 9):
        Unexpected EOF from the server
        OS error 115, "Operation now in progress"
Error 20002 (severity 9):
        Adaptive Server connection failed
There was a problem connecting to the server

also tried using settings in freetds.conf but same error

You need to make sure you're using TDS version 7.4 . Make sure tsql is up to date (you will very likely have to download, build and install from sources ) and then force the version from env:

TDSVER=7.4 tsql -H 'myserver.database.windows.net' -U 'myuser' -P 'mypass'

You can use sqlcmd as well.

sqlcmd -S 'myserver.database.windows.net' -U 'myuser' -P 'mypass'

for configuring sqlcmd use url:

https://docs.microsoft.com/en-us/sql/linux/quickstart-install-connect-ubuntu?view=sql-server-2017

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM