Permissions Problems Prevent Database Access

23,283

Solution 1

It could very well be a permissions problem. If you open Object Explorer in SQL Server Management Studio and expand the Security node (the one under the server instance, not the Security tab under the individual databases) and then expand the Logins node you'll see the list of logins that have been created on the server. Have a look at the properties of each of those and check out the User Mapping information. You'll be able to see which logins are mapped to which databases. It's possible the previous programmer only granted access to the database to certain logins. If you find a login that's mapped to the database you want, try changing the password of the login and then connecting to the database with that login and password. NOTE: be careful when changing the password as it may affect production applications that are using that login and password!

Solution 2

This message:

"One or more databases are inaccessible and will not be displayed in list."

Means that the user you are using right now cannot access to that db. If you can enter with a user that does have access and from that user change your actual user's rights through User Mapping, then you will see it.

Share:
23,283
Raven Dreamer
Author by

Raven Dreamer

Follow my hobby development at: https://storm-shark.itch.io/

Updated on August 25, 2020

Comments

  • Raven Dreamer
    Raven Dreamer almost 4 years

    Recently I inherited a database from another programmer (created / stored with SQL Management Studio 2008), and I am having massive difficulties accessing, modifying, or even viewing the previously created databases.

    Specifically, when I try to load one of the databases in SQL Management Studio I get the following error message:

    "The database [database name] is not accessible. (Object Explorer)"

    I am connecting to the SQL server with windows authentication.

    Anyway, is this a permissions issue left over from the last dev? (he's unavailable, unfortunately) And is there an easy work-around short of completely reinstalling SQL Management Studio?

    Edit: Update:

    Upon trying to access User Mapping, as suggested below, I got the following error message:

    "One or more databases are inaccessible and will not be displayed in list."
    

    Unfortunately, none of the databases I am trying to access appeared in the list, so I assume they are still inaccessible.

  • Raven Dreamer
    Raven Dreamer about 14 years
    I did as you suggested, and wound up with another error message when I tried to display the User Mapping: "One or more databases are inaccessible and will not be displayed in list." Unfortunately, none of the databases I am trying to access appeared in the list, so I assume they are still inaccessible.
  • TLiebe
    TLiebe about 14 years
    When SQL Server was installed it should have been created with a login for 'sa' (system administrator). This login by default should have full access to everything. Does anyone remember what the password for the 'sa' login is? If so, try logging in with that username.
  • Necoras
    Necoras over 8 years
    I'll add an additional potential cause. I've seen this error when the databases in question are mirrored to a primary server. The mirrored databases register as inaccessible and thus the login cannot be granted the necessary permissions to that database.