Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

User Auth Issue after Move of Db to another server

Posted on 2008-10-21
3
Medium Priority
?
163 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 1000 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

When it comes to showing a 404 error page to your visitors, you do not want that generic page to show, and you especially do not want your hosting provider’s ad error page to show either. In this article, I will show you how to enable the custom 40…
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
How can you see what you are working on when you want to see it while you to save a copy? Add a "Save As" icon to the Quick Access Toolbar, or QAT. That way, when you save a copy of a query, form, report, or other object you are modifying, you…

571 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