Solved

User Auth Issue after Move of Db to another server

Posted on 2008-10-21
3
159 Views
Last Modified: 2011-09-20
Hi Experts,

I am getting a User unable to login error after moving a Db to another server.
I followed these instructions to move the Db files
http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SQL-Server-2005/Q_22807851.html

I have run
ALTER AUTHORIZATION ON DATABASE::MyDbTO [SA]

and now I am getting error:
Microsoft OLE DB Provider for SQL Server (0x80040E4D)
Login failed for user 'WebsiteUser'.

Any Ideas?
0
Comment
Question by:Craig Lambie
  • 2
3 Comments
 
LVL 10

Accepted Solution

by:
jinn_hnnl earned 250 total points
ID: 22765781
make sure the login user and the access right are restored too.
If you open the security and check for user who has right

//when you restore a backup database : fix login error
EXEC sp_change_users_login 'Auto_Fix', 'anyone', NULL, 'password'

when you attach db or moving to another server,  the login mapping to that user account probably became disassociated during the move.

USE DatabaseName;
   ALTER USER MyUserName WITH NAME = AnyName;
GO

You can look at this

http://stackoverflow.com/questions/176851/cannot-open-user-default-database-login-failed-sql-2005

0
 
LVL 1

Author Closing Comment

by:Craig Lambie
ID: 31508173
Thanks, that is exactly what I needed!
0
 
LVL 10

Expert Comment

by:jinn_hnnl
ID: 22773974
Glad to help ^^

JINN
0

Featured Post

Backup Solution for AWS

Read about how CloudBerry Backup fully integrates your backups with Amazon S3 and Amazon Glacier to provide military-grade encryption and dramatically cut storage costs on any platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

INTRODUCTION: While tying your database objects into builds and your enterprise source control system takes a third-party product (like Visual Studio Database Edition or Red-Gate's SQL Source Control), you can achieve some protection using a sing…
Lync server 2013 or Skype for business Backup Service Error ID 4049 – After File Share Migration
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

685 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question