我正在使用带有 dotnet Core 和 EF Core 的 Visual Studio 2017 for mac。在 Docker 容器中设置 mssql 映像后,我试图添加连接字符串但抛出连接错误。我尝试使用不同的选项,例如 ip address 、 container name 、 host name 等作为服务器名称,但它们都不起作用。
"Default": "Server=172.17.0.2; Database=ERPDb; User=sa; Password =******;"
带有容器名称
"Default": "Server=ecstatic_hermann; Database=ERPDb; User=sa; Password=******;"
与主机名:
"Default": "Server=f45840a59623; Database=ERPDb; User=sa; Password=******;"
通过在终端中使用 localhost 连接时,它成功连接
$ mssql -s localhost -p Technocrat123
Connecting to localhost...done
sql-cli version 0.6.2
Enter ".help" for usage hints.
但是在运行应用程序时,连接失败。
感谢任何帮助。提前致谢。
如果使用 localhost 那么错误是
Login failed for user ''. Reason: An attempt to login using SQL authentication failed. Server is configured for Integrated authentication only.
原文由 user2695433 发布,翻译遵循 CC BY-SA 4.0 许可协议
然后,