MSSQL Database Connection Fails with Cannot open user default database

Discussion in 'ASP.NET 4.5 Beta [Closed]' started by SMehdi47, Jul 11, 2012.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. I was able to connect to this database last week.

    I updated my ASP.net 4.5 site this morning and hit this issue. My site uses EF code first. After receiving this error, I tried connecting to the database using SSMS, but hitting a Login failed error 4064.

    The errors I received from both the ASP.NET site and SSMS follow ....

    ________________________________________________________________
    ASP.NET SITE ERROR - http://user1258.netfx45lab.discountasp.net

    CREATE DATABASE permission denied in database 'master'.

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.Data.SqlClient.SqlException: CREATE DATABASE permission denied in database 'master'.


    _______________________________________________________________
    SSMS CONNECTION ERROR


    TITLE: Connect to Server
    ------------------------------

    Cannot connect to netfx45lab.discountasp.net.

    ------------------------------
    ADDITIONAL INFORMATION:

    Cannot open user default database. Login failed.
    Login failed for user 'user1258'. (Microsoft SQL Server, Error: 4064)

    For help, click: http://go.microsoft.com/fwlink?Prod...er&EvtSrc=MSSQLServer&EvtID=4064&LinkId=20476

    ------------------------------
    BUTTONS:

    OK
    ------------------------------
     
  2. Bruce

    Bruce DiscountASP.NET Staff

    the username you are using is incorrect. please check your welcome email again for you sql user.
     
  3. Login's Default Database

    SQL Username: user1258

    This is the username I received in email. It worked last week. It doesn't work anymore.

    According to the SQL error details related to this error, I need to alter my default database.

    From the error exception URL http://go.microsoft.com/fwlink?Prod...er&EvtSrc=MSSQLServer&EvtID=4064&LinkId=20476

    "Use ALTER LOGIN to change the login's default database. Grant CONNECT permission to the login."
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page