当前位置:网站首页>An error occurred using the connection to database 'on server' 10.28.253.2‘

An error occurred using the connection to database 'on server' 10.28.253.2‘

2022-06-26 03:44:00 yuyue5945

#EF Core Migration update-database When An error occurred using the connection to database ‘’ on server ‘10.28.253.2’

problem : Doing it EF Core Migration When ,Update-dataBase The instruction always reports an error. The error content is “An error occurred using the connection to database ‘’ on server ‘10.28.253.2’”

When doing data migration , Follow the routine operation

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

Before using the database connection string, you can query successfully , The string content is as follows

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

But after copying it today , Error in dead or alive execution , The error content is shown in the figure below :

20201224185813-2020-12-24

When you find your own mistakes , I also found the wrong sentence , Using the green icon “Access denied for user”, This is the last line of the execution error , There's a program that doesn't even appear “10.28.160.250” This address , Looking for a mess of code

Check the error code carefully , Find the wrong content at the beginning IP That's right. , But the hint doesn't connect , Red box content , So I added... To the connection string “Integrated Security=False;” Content , The problem is solved here .

“ConnectionStrings”:
“Default”: “Data Source = 10.28.253.2;Initial Catalog = SignalR;User Id = sa;Integrated Security=False;Password =Ecsgui123;”

se;Password =Ecsgui123;"

原网站

版权声明
本文为[yuyue5945]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202180546225162.html