You get the following error messages when you try to access your Microsoft SQL Server database with SQL Server Management Studio. The database may not be yours if you host your database in a shared server.
The server principal 'MyUser' is not able to access the database 'NotMyDB' under the current security context (Microsoft SQL Server, Error:916)
The problem is caused by the auto close status of the databases. We need to turn off the "auto close" of the database. Please follow these steps.
Go to SQL Server Management Studio > Management > SQL Server Logs. Open the current logs and find "Starting up database 'DBName'". Write the 'DBName' list.
Go to SQL Server Management Studio > Databases. Right click the database name and choose "Properties". Click "Options" in the left side and change "Auto Close" from "True" to "False".