Impossible to connect to instance with login admin

  • Hi,

    It's amazing, I am administrator of my server.

    I would like to put my dataBase in Off Line and juste after I have this message :

    Cannot connect to SRV1\MyInstance.

    Cannot open user default database. Login failed.

    Login failed for user 'SRV1\Administrateur'. (Microsoft SQL Server, Error: 4064)

    It's very stange, my other database in this instance works correctly.

    But I don't know why I can't to connect to my instance 'SRV1\MyInstance'. I can't to administrate my database.

    Thanks for your time.

     


    Kindest Regards,

    degrem_m
    Degremont

  • Good Morning,

    This could be too obvious but I still want to point our...

    'SRV1\Administrateur' ....should it be 'SRV1\Administrator' ??

  • I guess you are running a foreign language version of windows so no probs there.  The actual error message indicates that you can connect to SQL Server but the default database for your user does not exist (is it the one you detached) so it will not let you log in.  Can you connect via another account and change your default DB to master or reattach the missing DB?

    I've never been in this pickle, but you could try specifying the DB as part of your connection.  Eg, with the osql utility you could connect as

    osql -E -S [server] -d master

    Does that work?

  • Hello,

    lol santosh, my operating system is in french. 🙂

    I think that :

    osql - E

    sp_defaultdb 'user's login','master'

    go

    is only for SQL Server 2000.

    I try to use the sqlcmd utility to change the default database in sql 2005.


    Kindest Regards,

    degrem_m
    Degremont

  • If I use :

    I made Start >> Run... >> CMD

    In prompt I wrote :

    C:\Program Files\Microsoft SQL Server\90\Tools\Binn>sqlcmd –E -S myInstance –d master

    1>ALTER LOGIN server\windowslogin WITH DEFAULT_DATABASE = anotherdatebase

    2>GO

    It doesn't work. I have this message : error syntaxe "\" near windowslogin

    But I try with sql login and its works with :

    C:\Program Files\Microsoft SQL Server\90\Tools\Binn>sqlcmd –E -S myInstance –d master -U SQLLogin -P Password

    1>ALTER LOGIN SQLLogin  WITH DEFAULT_DATABASE = anotherdatebase

    2>GO

    How can I do ?

    I help me with http://msdn2.microsoft.com/en-US/library/ms189828.aspx

     

     


    Kindest Regards,

    degrem_m
    Degremont

  • I don't have a copy of SQL 2005 installed near me at the moment, but perhaps you need to put the DOMAIN\USERNAME in square brackets, such as

    ALTER LOGIN [DOMAIN\USER] WITH DEFAULT_DATABASE = anotherdatebase

    Sorry cannot be of more help - am still brushing up on 2005 syntax

  • yes, very thanks.

    Its works with square brackets.


    Kindest Regards,

    degrem_m
    Degremont

Viewing 7 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic. Login to reply