Skip to Content
avatar image
Former Member

Cannot open user default database on SQL Server 2008

We have installed ECC 6.0 with EHP4 Ready.

Recently we have upgraded our system to EHP4.

After rebooting our windows server, we are not able to connect to

database.

We are getting the below error.

=======================================================================

TITLE: Connect to Server

-


Cannot connect to MHEPL-ECCDEV.

-


ADDITIONAL INFORMATION:

Cannot open user default database. Login failed. Login failed for

user 'MHEPL-ECCDEV\medadm'. (Microsoft SQL Server, Error: 4064)

For help, click: http://go.microsoft.com/fwlink?

ProdName=MicrosoftSQLServer&EvtSrc=MSSQLServer&EvtID=4064&LinkId=20476

-


BUTTONS:

OK

-


=======================================================================

Already default database of SAPService<SID> and <sid>adm is set to

<SID>.

I have already gone through SAP Note 806925 - SQL Error 4064: Cannot

open user default database, but it did not help.

Here by I am attaching the screen shots also.

Request you to kindly look into this and suggest us.

Regards,

Raj

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

3 Answers

  • avatar image
    Former Member
    Sep 07, 2011 at 10:35 AM

    Hello,

    Did you check the microsoft link provided in that note ?

    http://support.microsoft.com/kb/307864

    After windows reboot, are sql services up now ? If not then this might be the reason as well.

    Thanks

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hello,

      I don't really get the idea how a non-running SQL Server instance service could ever be the reason for a "Cannot open user default database" error.

      It seems that the basic concept is not understood at all. The SQL Server instance service represents the SQL Server instance. When it's up, the instance is up and (if no other problems) will accept requests and reply to them. The error message "cannot open user default database" comes from the instance. It's a reply from the instance. If the instance was down you would get completely different errors, e.g. "SQL Server doesn't exist or access denied"

      You encounter this error for the <sid>adm user - if you're database setup follows the SAP standard the default database of this user should be the <SID> database. As it cannot be opened there must be either something wrong with the <SID> database and it's currently not open or the default database setting of the <sid>adm user is incorrect and is point to a non-existing database.

      To find out which of these applies you need to look into the most current errorlog of the database. Does it say that the DB could be started up properly? If no, check why and resolve the root cause.

      To your second question: why does your osql command not work? Simply answer -> because it's incorrect

      Not incorrect for SQL Server 2008 or any specific release, but simply incorrect in general.

      When using osql commands you do not use spaces between the option character and the option value. Assuming my instance is called DETEST\PRD and I want to log on to it with Windows Authentication and osql:

      osql -E -S DETEST\PRD <<<< is WRONG

      osql -E -SDETEST\PRD <<<< is CORRECT

      This applies for all option flags you used so your command failed because it was written with incorrect syntax.

      regards,

      beate

  • avatar image
    Former Member
    Aug 09, 2014 at 11:14 AM

    Are you facing problem like SQL error 4064 while login in SQL default database then try SQL password recovery software and remove it easily :- http://sqlrecoverysoftware.net/blog/sql-error-4064.html

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 01, 2015 at 04:31 AM

    Hi Experts

    I'm facing similar kind of issue with SQL database server while installing SAP NetWeaver Gateway in distributed environment. Can you please check below thread and let me know your expert advice/views:

    SQL server doesn't exist or access denied || SA... | SCN

    Regards

    Hardeep

    Add comment
    10|10000 characters needed characters exceeded