3

Upgraded mssql-server this morning and I can't connect to it anymore

sqlcmd -S localhost -U SA -P xxxxxxxx

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.

From SSMS:

A connection was successfully established with the server, but then an error occurred during the login process. (provider: SSL Provider, error: 0) (Microsoft SQL Server, Error: 10054)

OS Debian 9 up-to-date

OpenSSL OpenSSL 1.0.1t 3 May 2016 and OpenSSL 1.1.1c 28 May 2019

SQL Server SQL Server 2017

Otto
  • 4,020
  • 6
  • 35
  • 46

2 Answers2

5

The reason why you are having issues with this is because SQL Server 2017/2019 packages meant for Ubuntu 16.04 have a dependency on OpenSSL version 1.0. While your Debian openssl seems to be on 1.1. Until we get a package meant for Ubuntu 18.04 with openssl 1.1 updates, you can follow the steps in additional note of following blog and create links to libssl.so and libcrypto.so for version 1.0 into /opt/mssql/lib path.

https://techcommunity.microsoft.com/t5/SQL-Server/Installing-SQL-Server-2017-for-Linux-on-Ubuntu-18-04-LTS/ba-p/385983

Once the appropriate links are created, the connectivity to SQL Server should work.

Tejas Shah
  • 81
  • 2
  • I did all the steps and I have the same problem unfortunately Error code 0x2746 I already had libcurl3, "libcurl3 is already the newest version (7.52.1-5+deb9u9)." @Tejas Shah Welcome to StackOverflow! – Otto Aug 03 '19 at 22:20
  • I meant the steps about creating softlinks for libssl.so and libcrypto.so to /opt/mssql/lib folder. First "locate" these two files similar to below. – Tejas Shah Aug 05 '19 at 11:13
3

I meant the steps about creating softlinks for libssl.so and libcrypto.so to /opt/mssql/lib folder. First "locate" these two files similar to below.

root@gf-sql19-ub:/# locate libcrypto.so
/usr/lib/x86_64-linux-gnu/libcrypto.so.1.0.0
/usr/lib/x86_64-linux-gnu/libcrypto.so.1.1
root@gf-sql19-ub:/# locate libssl.so
/usr/lib/x86_64-linux-gnu/libssl.so.1.0.0
/usr/lib/x86_64-linux-gnu/libssl.so.1.1

once you have located the links create soft links. (Note, if paths for debian 9 are different, change them accordingly. If you do not find these two files, then you may have to manually install openssl 1.0 packages manually from debian9 repo and locate those files.)

cd /opt/mssql/lib
ln -s /usr/lib/x86_64-linux-gnu/libcrypto.so.1.0.0 libcrypto.so
ln -s /usr/lib/x86_64-linux-gnu/libssl.so.1.0.0 libssl.so
Tejas Shah
  • 81
  • 2
  • I did that, the paths were the same but I have still the same Error code 0x2746 – Otto Aug 08 '19 at 09:08
  • Also tried all solutions in this link: https://stackoverflow.com/questions/57265913/error-tcp-provider-error-code-0x2746-during-the-sql-setup-in-linux-through-te/57343207#57343207 – Otto Aug 08 '19 at 09:53
  • The solution was verified on SLES and Ubuntu 18.04. Not sure of Debian 9 nuances. If you DM me on Twitter (@mr_tejs) with your contact info, i can put you in touch with support team to look into it. – Tejas Shah Aug 09 '19 at 11:16
  • I am on fedora and experiencing the same problems. Any help please? @TejasShah – Pavan G R Oct 25 '19 at 08:11