sqlsql-serverssmslocaldb

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


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.

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


Solution

  • Warning: this will delete all your databases located in MSSQLLocalDB. Proceed with caution.

    The following command through sqllocaldb utility works for me.

    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