How to set login name after login only to see and operate a database this user cannot see the other database

Source: Internet
Author: User

How to set login name after login only to see and operate a database this user cannot see other databases
There are three databases on a server I want to create three new logins each login can only see the corresponding database can not see the remaining two how to set it?

Share to:


------Solution--------------------
1. SQL database Assignment permissions
Open the Sql-server management tool? security? Login name? Right-click (new Login)

Enter the appropriate information (here to remove the mandatory password policy, enforce password expiration, the user must change the password at the next logon selection)

User mapping? Select the database that we want to set permissions for? Set permissions for new users by selecting database role Memberships

General permissions for the entire library when all the permissions are required to check the db_owner (OK)
This will allow us to access our database server with our newly created username, and this username will only have all the permissions of the database we have checked.


------Solution--------------------
Each database is set up with a set of permissions to make an account
------Solution--------------------
Remove the View any DATABASE permission from the public role.

Simply explain:
The public role defaults to view any database permissions, which means that metadata describing all the databases can be viewed.
All database users inherit the public role by default. This means that all database users can view the metadata for all databases by default.

------Solution--------------------

DENY VIEW any DATABASE to public


------Solution--------------------
GRANT VIEW any DATABASE to public
We can recover.
------Solution--------------------
Look at this, it should be useful to you, you want the login to see several databases, you see several databases.

How to set login name after login only to see and operate a database this user cannot see the other 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.