2

I get a problem today with my sql-server on linux, my dotnet app stop work cause cant connect to sql-server on localhost, but work OK on my production database on azure.

Using sqlcmd -S localhost,1433 -U SA -p or to connect with user on a database I get

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.

if I use sqlcmd to connect on my production database on azure work OK if I use sqlectron to connection on my localhost database work OK

after I get error to connect

$ ss -atunp | grep 1433
tcp    LISTEN     0      128       *:1433                  *:*                  
tcp    TIME-WAIT  0      0      127.0.1.1:1433               127.0.0.1:42839              
tcp    LISTEN     0      128      :::1433                 :::*  

after I connect with sqlectron

$ sudo ss -atunp | grep 1433
tcp    LISTEN     0      128       *:1433                  *:*                   users:(("sqlservr",pid=4312,fd=134))
tcp    ESTAB      0      0      127.0.0.1:51466              127.0.0.1:1433                users:(("sqlectron",pid=4689,fd=94))
tcp    ESTAB      0      0      127.0.0.1:51468              127.0.0.1:1433                users:(("sqlectron",pid=4689,fd=96))
tcp    ESTAB      0      0      127.0.0.1:1433               127.0.0.1:51464               users:(("sqlservr",pid=4312,fd=142))
tcp    ESTAB      0      0      127.0.0.1:1433               127.0.0.1:51468               users:(("sqlservr",pid=4312,fd=148))
tcp    ESTAB      0      0      127.0.0.1:51470              127.0.0.1:1433                users:(("sqlectron",pid=4689,fd=97))
tcp    ESTAB      0      0      127.0.0.1:51472              127.0.0.1:1433                users:(("sqlectron",pid=4689,fd=98))
tcp    ESTAB      0      0      127.0.0.1:1433               127.0.0.1:51462               users:(("sqlservr",pid=4312,fd=85))
tcp    ESTAB      0      0      127.0.0.1:51462              127.0.0.1:1433                users:(("sqlectron",pid=4689,fd=87))
tcp    ESTAB      0      0      127.0.0.1:1433               127.0.0.1:51466               users:(("sqlservr",pid=4312,fd=147))
tcp    TIME-WAIT  0      0      127.0.0.1:1433               127.0.0.1:53693              
tcp    ESTAB      0      0      127.0.0.1:1433               127.0.0.1:51470               users:(("sqlservr",pid=4312,fd=149))
tcp    ES -atunp | grep 1433
tcp    LISTEN     0      128       *:1433                  *:*                   users:(("sqlservr",pid=4312,fd=134))
tcp    ESTAB      0      0      127.0.0.1:51466              127.0.0.1:1433                users:(("sqlectron",pid=4689,fd=94))
tcp    ESTAB      0      0      127.0.0.1:51468              127.0.0.1:1433                users:(("sqlectron",pid=4689,fd=96))
tcp    ESTAB      0      0      127.0.0.1:1433               127.0.0.1:51464               users:(("sqlservr",pid=4312,fd=142))
tcp    ESTAB      0      0      127.0.0.1:1433               127.0.0.1:51468               users:(("sqlservr",pid=4312,fd=148))
tcp    ESTAB      0      0      127.0.0.1:51470              127.0.0.1:1433                users:(("sqlectron",pid=4689,fd=97))
tcp    ESTAB      0      0      127.0.0.1:51472              127.0.0.1:1433                users:(("sqlectron",pid=4689,fd=98))
tcp    ESTAB      0      0      127.0.0.1:1433               127.0.0.1:51462               users:(("sqlservr",pid=4312,fd=85))
tcp    ESTAB      0      0      127.0.0.1:51462              127.0.0.1:1433                users:(("sqlectron",pid=4689,fd=87))
tcp    ESTAB      0      0      127.0.0.1:1433               127.0.0.1:51466               users:(("sqlservr",pid=4312,fd=147))
tcp    TIME-WAIT  0      0      127.0.0.1:1433               127.0.0.1:53693              
tcp    ESTAB      0      0      127.0.0.1:1433               127.0.0.1:51470               users:(("sqlservr",pid=4312,fd=149))
tcp    ESTAB      0      0      127.0.0.1:1433               127.0.0.1:51472               users:(("sqlservr",pid=4312,fd=150))
tcp    ESTAB      0      0      127.0.0.1:51464              127.0.0.1:1433                users:(("sqlectron",pid=4689,fd=91))
tcp    LISTEN     0      128      :::1433                 :::*                   users:(("sqlservr",pid=4312,fd=128))
TAB      0      0      127.0.0.1:1433               127.0.0.1:51472               users:(("sqlservr",pid=4312,fd=150))
tcp    ESTAB      0      0      127.0.0.1:51464              127.0.0.1:1433                users:(("sqlectron",pid=4689,fd=91))
tcp    LISTEN     0      128      :::1433                 :::*                   users:(("sqlservr",pid=4312,fd=128))

I try complete uninstall and install, but not success.

Server are running,

$ service mssql-server status
● mssql-server.service - Microsoft SQL Server Database Engine
   Loaded: loaded (/lib/systemd/system/mssql-server.service; enabled; vendor preset: enabled)
   Active: active (running) since Mon 2018-04-09 18:34:06 -03; 37min ago
     Docs: https://learn.microsoft.com/en-us/sql/linux
 Main PID: 683 (sqlservr)
    Tasks: 168
   Memory: 1.5G
      CPU: 56.406s
   CGroup: /system.slice/mssql-server.service
           ├─683 /opt/mssql/bin/sqlservr
           └─843 /opt/mssql/bin/sqlservr

Warning: Journal has been rotated since unit was started. Log output is incomplete or unavailable.

I can connect with SqlElectron, but with sqlcmd or dotnet program no.

My problem is not with SqlServer, is with libssl on linux, if i try connect with SqlElectron with SSL connection fail.

msmaldi
  • 59
  • 6
  • Sounds like the service isn't running, is it? What do the logs say if you try to start the service? It would also be worth while tagging the Linux distro you're using; they all differ. Linux isn't an operating system on its own. – Thom A Apr 09 '18 at 21:44
  • I am using deepin, server are running, i can connect with Sqlectron – msmaldi Apr 09 '18 at 22:11
  • I'm not so familiar with Debian I'm afraid. I can't see that you've checked the logs though, did you? Thanks. – Thom A Apr 10 '18 at 07:36
  • This answer may simplify everything you needed to do: https://stackoverflow.com/a/61111267/9535070 – ofundefined Apr 08 '20 at 23:00

0 Answers0