web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Dynamics 365 Community / Blogs / Aric Levin's Blog / Login failed for user after...

Login failed for user after database restore

Aric Levin - MVP Profile Picture Aric Levin - MVP 30,190 Moderator

When using SQL Server logins to connect to a database that has just been restored, most likely the following error will appear: Login failed for User 'username'

When using SQL Server logins to conect to a database that has just been restored, most likely the following error will appear:

Login failed for User 'username'

or

Cannot open database 'dbname' requested by the login. The login failed. Login failed for user 'username'.

The reason for this error is that the user login and the database login have become disconnected. We need to relink the database user with the login:

sp_change_users_login 'UPDATE_ONE', 'username', 'username'

Comments

*This post is locked for comments