Coder Perfect

Error: Error code 0x2746 from TCP Provider. During the Sql installation in Linux through terminal


I’m attempting to install the MS-SQL server on my Linux system using the documentation found at

The status of the SQL server is Active (Running).

During the execution of the command, I receive the following error:

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


I also attempted it by issuing the command.

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

However, the same problem appears. It also displays the same problem when I try a different password.

Asked by Suba Nandhini K

Solution #1

[UPDATE 17.03.2020: Microsoft has published SQL Server 2019 CU3 with a repository for Ubuntu 18.04. See for more information. I’m hoping that this is now totally compatible with no SSL issues. [I haven’t tried it yet, jet.]

Reverting to 14.0.3192.2-2 solves the problem.

However, the solution suggested by Ola774 may be used to remedy the problem not only while upgrading from Ubuntu 16.04 to 18.04, but on any installation of SQL Server 2017 on Ubuntu 18.04.

Microsoft appears to have screwed up their own patch for the ssl-version difficulties that was implemented in cu10 ( in cu16. However, linking the ssl 1.0.0 libraries is successful.

So here’s what you should do:

This will override the original service configuration. When the override-file, or more precisely “drop-in-file,” is used for the first time, it is correct that it is empty.

Answered by MSSQL_Ubuntu

Solution #2

Revert to the previously default weaker key length if you’re encountering problems with the client on Debian 10 with OpenSSL1.1.1. To do so, follow these steps:

Modify the config file /etc/ssl/openssl.cnf as follows (fyi, read the list of known issues with OpenSSL 1.1.1 on Debian 10 below):

Change CipherString = DEFAULT@SECLEVEL=2 to CipherString = DEFAULT@SECLEVEL=1 on the last line.

Answered by miktea

Solution #3

sudo apt-get install mssql-server=14.0.3192.2-2

For me, reverting to this version worked.

My case was a fresh install of Ubuntu Server 18.04.2 with everything up to date, and I was getting the following client connection issue from sqlcmd:

Microsoft ODBC Driver 17 for SQL Server: Sqlcmd: Error: Provider of TCP: 0x2746 is the error code.

Answered by Kurt Preston

Solution #4

There are still some concerns after upgrading from Ubuntu 16.04 to 18.04.

To connect to SQL Server, some systems may require version 1.0 of the OpenSSL library. It is possible to use OpenSSL 1.0 in the following way:

Stop SQL Server

sudo systemctl stop mssql-server

Start the service configuration editor.

sudo systemctl edit mssql-server

Add the following lines to the file in the editor and save it:


For SQL Server to use, create symbolic links to OpenSSL 1.0.

sudo ln -s /usr/lib/x86_64-linux-gnu/ /opt/mssql/lib/
sudo ln -s /usr/lib/x86_64-linux-gnu/ /opt/mssql/lib/

Start SQL Server

sudo systemctl start mssql-server

I hope this information is useful.

Answered by Ola774

Solution #5

Error code 0x2746 from TCP Provider

This is most likely due to a conflict between the openssl and sql-server protocols and versions.

Check the version of openssl you’re using. Open your terminal and type the following command: openssl version

$ openssl version
OpenSSL 1.0.2k-fips  26 Jan 2017

If your openssl version is not 1.0, you may wish to try one of the following solutions to fix the connection problem:

sed -i -E 's/(CipherString\s*=\s*DEFAULT@SECLEVEL=)2/\11/' /etc/ssl/openssl.cnf

Yes, it is correct. cnf.

If you have SECLEVEL set to 1 in your /etc/ssl/openssl.cnf file, this command will set it to 1. Done.

If your version of openssl is 1.1, you’d probably prefer it to be 1.0. The procedure is straightforward: download the source code, configure it, then generate the binary. It can take a few minutes to put everything together:

cd /usr/local/src/
tar -xvf /usr/local/src/openssl-1.0.1k.tar.gz
cd /usr/local/src/openssl-1.0.1k
./config --prefix=/usr/local/ --openssldir=/usr/local/openssl
make test
make install
mv /usr/bin/openssl /usr/bin/openssl-bak


cp -p /usr/local/openssl/bin/openssl /usr/bin/openssl


cp -p /usr/local/ssl/bin/openssl /usr/bin/openssl
ll -ld /usr/bin/openssl
openssl version

If you need help with something specific, such as a Docker image or a different system, please leave a comment.

Answered by ofundefined

Post is based on