Applicable to:
- Plesk for Windows
Symptoms
MS SQL database users are able to see names of MS SQL databases which are not owned by them.
Cause
Default MS SQL server behavior.
Resolution
Warning: User's databases will not be listed in MS SQL Management Studio after the solution below.
Note: 'MASTER' and 'TEMPDB' databases will always be visible to all users. It is not possible to make them invisible.
To revoke the permissions, do the following:
-
Connect to the server via RDP.
-
Open SQL Server Management Studio either locally, or via remote connection. Or use any web admin like MyLittleAdmin to access the database (Tools & Settings > Database Servers > Web admin).
-
Select the master database from the list of databases. Once the database is selected, click the button New Query.
-
Run the following SQL query to hide databases for all users:
CONFIG_TEXT: USE master;
It is possible to revert changes using the following query:
REVOKE VIEW ANY DATABASE TO PUBLIC;
GOCONFIG_TEXT: USE master;
GRANT VIEW ANY DATABASE TO PUBLIC;
GO
Comments
4 comments
This will hide all the databases. The logged in user will not see databases he has permission and created through plesk also
Hi @Baiju Mathew,
Yes, you are right. I changed 'note' in the article regarding this behavior to 'warning' to make it clear.
Baiju Mathew This will hide all the databases. The logged-in user will not see databases he has permission and created through Plesk also
we also tried same issue our end.
Hello Sathiya,
This is an expected behavior defined by MS SQL operation logic. That's mentioned in the Warning to this article.
Please sign in to leave a comment.