Cannot open user default database. Login failed. SQL Server 2005 Express

Posted on 2007-10-03
Last Modified: 2012-06-27
I am having trouble getting my new webpage online, I am running into the following error...

Cannot open user default database. Login failed.
Login failed for user 'NT AUTHORITY\NETWORK SERVICE'.

I have been googling around and have found several responses to this error, but I do not know where to get the program they are referring too, I think it may be with the Full version of SQL Server 2005, when I am using SQL Server 2005 Express....

How to solve my problem can be found here...

Thank you, any ideas are greatly appreciated.
Question by:addicktz
    LVL 30

    Accepted Solution

    No its nothing to do with the version.

    The Login 'NT AUTHORITY\NETWORK SERVICE' has been added as a login, but it does not have access to the database that is specified as its defauly.

    Do you know what database you want to connect to? Either change this users default database to the one you want, or give the user access to the database.

    Have you downloaded SQL Management Studio?
    LVL 19

    Assisted Solution

    did you restore the db or reattach it from a different server?
    sometimes there will be problems if a db is restored before the database users's login was created on the server. if thats the case you'll have to delete the db user, and then assign permission on that user login to that db (which then automatically create the db user again)
    LVL 14

    Assisted Solution

    if you are trying to connect using a FRONT END (like .NET etc) you probably need to specify a database for which the user "NT..." has the permission...

    if not then
    it appears that the user does not have access to ANY database in the server and it is just the login name that has been created,...
    LVL 27

    Assisted Solution

    Use the SQL Server Management Studio Express > Security > logins.

    Right-click on NT Authority\Network Service, select Properties. On the bottom of the General page, instead of Master, choose a database that the service should access (the database used by your Web application).

    LVL 30

    Assisted Solution

    ....and make sure it actually has access to the db you select, or you will have exactly the same problem. To make sure it has access, in the login screen, go to the second tab and give it access.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Free Trending Threat Insights Every Day

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Introduction SQL Server Integration Services can read XML files, that’s known by every BI developer.  (If you didn’t, don’t worry, I’m aiming this article at newcomers as well.) But how far can you go?  When does the XML Source component become …
    It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
    Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
    Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now