MSSQL 2019 A connection was successfully established with the server

seloBaba 6 Reputation points
2020-09-17T20:36:50.103+00:00

I use Microsoft SQL Server 2019 (RTM-CU7) (KB4570012) - 15.0.4063.15 (X64) Aug 15 2020 10:48:11 Copyright (C) 2019 Microsoft Corporation Developer Edition (64-bit) on Linux (Ubuntu 18.04.5 LTS)

I develop with .net core 3.1.8 web api using Kestrel :

problem/error message: A connection was successfully established with the server, but then an error occurred during the login process. (provider: TCP Provider, error: 0 - Success)

What can be the problem?

my config file:

 [sqlagent]
 enabled = false

 [EULA]
 accepteula = Y

 [coredump]
 captureminiandfull = true
 coredumptype = full

 [network]
 forceencryption = 0
 ipaddress = xx.xx.xx.xxx

my connection string:

$"Server={ServerName};Database={DBName};User Id={UserName};Password={Password};Max Pool Size=50000;Pooling=True;"

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
13,361 questions
{count} vote

1 answer

Sort by: Most helpful
  1. Anup Sharma 1 Reputation point
    2021-03-21T15:44:15.113+00:00

    I used to get this message

    A connection was successfully established with the server, but then an error occurred during the login process. (provider: TCP Provider, error: 0 - Success)

    on my application running on centos 8 having SQL server every now and then. When I used to log in manually to the SQL server using the same credential, then it used to start working again for some time and after a couple of hours, the same issue used to popup.
    After going through the SQL error log, I found that there was quite a bit of failed login attempt for the user name. I instantly disabled/renamed that user and created another user with a very big user name to use with my application.
    Now no issues.
    So I believe, after multiple failed login attempts on the server, it would deny any and all requests from the same user even if the credential were correct. Possibly to keep the hackers/bots at bay. So make sure the username you are using is not common ones like sa, su, admin, etc.