错误:TCP提供程序:错误代码0x2746.在Linux中通过终端安装Sql期间 [英] Error: TCP Provider: Error code 0x2746. During the Sql setup in linux through terminal

查看:1033
本文介绍了错误:TCP提供程序:错误代码0x2746.在Linux中通过终端安装Sql期间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试按照文档在Linux中设置ms-sql服务器 https://docs.microsoft.com/pl-pl/sql/linux/quickstart-install-connect-ubuntu?view=sql-server-2017

I am trying to setup the ms-sql server in my linux by following the documentation https://docs.microsoft.com/pl-pl/sql/linux/quickstart-install-connect-ubuntu?view=sql-server-2017

SQL Server状态为活动(正在运行)".

The SQL server status is Active (Running).

执行命令时出现以下错误

I am getting the following error while executing the command

sqlcmd -S localhost -U SA -P '<YourPassword>'

错误:

Sqlcmd:错误:SQL Server的Microsoft ODBC驱动程序17:TCP提供程序: 错误代码0x2746. Sqlcmd:错误:SQL的Microsoft ODBC驱动程序17 服务器:客户端无法建立连接.

Sqlcmd: Error: Microsoft ODBC Driver 17 for SQL Server : TCP Provider: Error code 0x2746. Sqlcmd: Error: Microsoft ODBC Driver 17 for SQL Server : Client unable to establish connection.

我也尝试通过给出命令

sqlcmd -S 127.0.0.1 -U SA -P '<YourPassword>' 

但是会显示相同的错误.当我尝试输入错误的密码时,它还会显示相同的错误.

But the same error is displayed. When I tried the wrong password it also displays the same error.

推荐答案

[更新17.03.2020:Microsoft已发布带有Ubuntu 18.04存储库的SQL Server 2019 CU3.请参阅:

[UPDATE 17.03.2020: Microsoft has released SQL Server 2019 CU3 with an Ubuntu 18.04 repository. See: https://techcommunity.microsoft.com/t5/sql-server/sql-server-2019-now-available-on-ubuntu-18-04-supported-on-sles/ba-p/1232210 . I hope this is now fully compatible without any ssl problems. Haven't tested it jet.]

恢复为14.0.3192.2-2很有帮助.

Reverting to 14.0.3192.2-2 helps.

但是,不仅在从Ubuntu 16.04升级到18.04的情况下,而且在Ubuntu 18.04上的每次SQL Server 2017安装中,也可以使用Ola774指示的方法来解决问题.

But it's possible to solve the problem also using the method indicated by Ola774, not only in case of upgrade from Ubuntu 16.04 to 18.04, but on every installation of SQL Server 2017 on Ubuntu 18.04.

看来,现在cu16中的Microsoft搞砸了自己的补丁,以解决cu10中应用的ssl版本问题(

It seems that Microsoft now in cu16 messed up with their own patch for the ssl-version problems applied in cu10 (https://techcommunity.microsoft.com/t5/SQL-Server/Installing-SQL-Server-2017-for-Linux-on-Ubuntu-18-04-LTS/ba-p/385983). But linking the ssl 1.0.0 libraries works.

因此,请执行以下操作:

So just do the following:

  1. 停止SQL Server

  1. Stop SQL Server

sudo systemctl stop mssql-server 

  • 通过以下方式打开服务配置的编辑器

  • Open the editor for the service configuration by

    sudo systemctl edit mssql-server 
    

  • 这将为原始服务配置创建替代.第一次使用替代文件(或更确切地说是插入文件")为空是正确的.

    This will create an override for the original service config. It's correct that the override-file, or, more exactly "drop-in-file", is empty when used the first time.

    1. 在编辑器中,将以下行添加到文件中并保存:

    1. In the editor, add the following lines to the file and save it:

    [Service]
    Environment="LD_LIBRARY_PATH=/opt/mssql/lib" 
    

  • 创建指向OpenSSL 1.0的符号链接以供SQL Server使用:

  • Create symbolic links to OpenSSL 1.0 for SQL Server to use:

    sudo ln -s /usr/lib/x86_64-linux-gnu/libssl.so.1.0.0 /opt/mssql/lib/libssl.so 
    sudo ln -s /usr/lib/x86_64-linux-gnu/libcrypto.so.1.0.0 /opt/mssql/lib/libcrypto.so 
    

  • 启动SQL Server

  • Start SQL Server

    sudo systemctl start mssql-server 
    

  • 这篇关于错误:TCP提供程序:错误代码0x2746.在Linux中通过终端安装Sql期间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆