SQL 无法连接到 (LocalDB)\MSSQLLocalDB -> 用户“User-PC\User”登录失败

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/36950078/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-01 04:35:45  来源:igfitidea点击:

Cannot connect to (LocalDB)\MSSQLLocalDB -> Login failed for user 'User-PC\User'

sqlsql-serverssmslocaldb

提问by Musakkhir Sayyed

I am getting an error, While I am trying to connect (LocalDB)\MSSQLLocalDB through SQL Server management studio. I also tried to login with default database as master the error is same.

当我尝试通过 SQL Server 管理工作室连接 (LocalDB)\MSSQLLocalDB 时,出现错误。我还尝试使用默认数据库作为 master 登录,但错误相同。

enter image description hereHere is the Server details. enter image description here

在此处输入图片说明这是服务器的详细信息。 在此处输入图片说明

回答by Musakkhir Sayyed

The following command through sqllocaldb utility works for me.

通过 sqllocaldb 实用程序的以下命令对我有用。

sqllocaldb stop mssqllocaldb
sqllocaldb delete mssqllocaldb
sqllocaldb start "MSSQLLocalDB"

enter image description here

在此处输入图片说明

After that I restarted the sql server management studio, and it is successfully established connection through (LocalDB)\MSSQLLocalDB

之后我重新启动了sql server management studio,它通过以下方式成功建立了连接 (LocalDB)\MSSQLLocalDB