简体   繁体   English

无法从ubuntu连接到Azure SQL Server

[英]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 尝试使用以下命令从终端访问我的Azure SQL服务器时出现以下错误

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 也尝试在freetds.conf中使用设置,但存在相同错误

You need to make sure you're using TDS version 7.4 . 您需要确保使用的是TDS 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: 确保tsql是最新的(您很可能必须从来源下载,构建和安装 ),然后从env强制版本:

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

You can use sqlcmd as well. 您也可以使用sqlcmd。

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

for configuring sqlcmd use url: 用于配置sqlcmd的URL:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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