Solved

User Auth Issue after Move of Db to another server

Posted on 2008-10-21
3
157 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

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

Suggested Solutions

Introduction: When running hybrid database environments, you often need to query some data from a remote db of any type, while being connected to your MS SQL Server database. Problems start when you try to combine that with some "user input" pass…
In this article I will describe the Copy Database Wizard method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

932 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now