An error occurred using the connection to database on server

created at 07-05-2021 views: 464

error message

When doing EF Core Migration, the Update-dataBase command always reports an error: 

"An error occurred using the connection to database'' on server ''"

When doing data migration, follow the usual operations

  • Add-Migration init (execute this command project to generate a directory (Migration))
  • Update-Database init

The database connection string used can be successfully queried before, and the string content is as follows

"ConnectionStrings": {
    "Default": "Data Source =;Initial Catalog = SignalR;User Id = sa;Password =Ecsgui123;"

However, after copying it today, a life-and-death execution error was reported. The error content is shown in the following figure:

error message


When I was looking for the error, I also found the wrong sentence. I used the "Access denied for user" in the green icon. This sentence is the prompt message of the last line of the execution error. There is a "" that is not always present in the program. "This address, I found a garbled code

Checking the error code carefully, I found that the initial error content IP is correct, but the message is not connected, the red box content, so I added the content of "Integrated Security=False;" to the connection string, and the problem is solved here.


"Default": "Data Source =;Initial Catalog = SignalR;User Id = sa;Integrated Security=False;Password =Ecsgui123;"
created at:07-05-2021
edited at: 07-05-2021: