Results 1 to 4 of 4

Thread: error 4064, cannot open user default database

  1. #1
    Suhen Guest

    error 4064, cannot open user default database

    I am experiencing some login problems.

    When I connect to SQL Server 2000 using SQL Server authentication I get error message error 4064, cannot open user default database. I can connect however if I use Windows Authentication.
    The problem started when I did the ffg.
    -backup sql db1
    -restore db1 to another name (db2)
    -drop db1
    -use sp_detach
    -use sp_attach to attach db2 as db1 (rename database)

    When I connect in Query Analyzer via SQL Authentication I get the error, however via any other method it works fine.

    Regards
    Suhen

  2. #2
    Suhen Guest

    error 4064, cannot open user default database (reply)

    Thanks,

    They did not have a default database set.

    Regards
    Suhen

    ------------
    tom goltl at 10/17/01 10:31:42 AM

    Suhen,
    You don't have access to your default database with the sql authenticated login. Go into security, logins and choose your login and check to see what the default database is. Change it to one that you have access to and things will work.

    Tom


    ------------
    Suhen at 10/17/01 2:47:51 AM

    I am experiencing some login problems.

    When I connect to SQL Server 2000 using SQL Server authentication I get error message error 4064, cannot open user default database. I can connect however if I use Windows Authentication.
    The problem started when I did the ffg.
    -backup sql db1
    -restore db1 to another name (db2)
    -drop db1
    -use sp_detach
    -use sp_attach to attach db2 as db1 (rename database)

    When I connect in Query Analyzer via SQL Authentication I get the error, however via any other method it works fine.

    Regards
    Suhen

  3. #3
    Join Date
    Aug 2014
    Posts
    1
    To resolve such error you must specify a valid, available database in the connection string. To avoid the error when the user's default database is unavailable, log on as a user who can modify logins. Then, change the user's default database to a database that is currently available for a connection.

  4. #4
    Join Date
    Sep 2002
    Posts
    5,938
    After 13 years?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •