Workaround for database new user prompting "user, group or role ' XXX ' already exists in current database"

Source: Internet
Author: User

Typically, when a database is restored, a login name is added to the database.

For example, the database backup file already contains the user ABC, now restore the database, and then found that the existing database does not have the ABC user, want to create a new ABC user, as the owner of the database, this problem occurs.

http://blog.csdn.net/cjh200102/article/details/8669166 This article for a detailed introduction.

It can be understood that logins and users are two different concepts, although the names are the same. When you create a new login, you do not get an error if you do not add the database map.

Adding a database map is equivalent to adding a user with the same name to the database. However, there is already a user of ABC, so this will be an error.

You can resolve the problem by using the following methods.

1. Create a new ABC login name, but do not add a database mapping.

2. Use the script to associate the orphaned user ABC to the LOGIN ABC:

Use [Database name]gosp_change_users_login ' Update_One ', ' abc ', ' ABC '

Workaround for database new user prompting "user, group or role ' XXX ' already exists in current database"

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.