• 【转载]】Microsoft SQL Server, 错误:4064的解决方法


    SQL SERVER – Fix : Error: 4064 – Cannot open user default database. Login failed. Login failed for user
    November 4, 2008 by pinaldave

    I have received following question nearly 10 times in last week though emails. Many users have received following error while connecting to the database. This error happens when database is dropped for which is default for some of the database user. When user try to login and their default database is dropped following error shows up.

    Cannot open user default database. Login failed.
    Login failed for user ‘UserName’. (Microsoft SQL Server, Error: 4064)

     

    The fix for this problem is very simple.

    Fix/Workaround/Solution:

    First click on Option>> Button of “Connect to Server” Prompt.

     

    Now change the connect to database to any existing database on your server like master or msdb.

     

    Now click on connect and it will successfully log you in. Once you login in the system run following statement for your username and it should fix your problem. Make sure to replace [test] with your username and master with yourdatabase name.

    ALTER LOGIN [test] WITH DEFAULT_DATABASE = master GO

    本文来自CSDN博客:http://blog.csdn.net/JimFire/archive/2009/12/29/5096633.aspx 

    Reference Web URL:http://www.microsoft.com/products/ee/transform.aspx?ProdName=Microsoft+SQL+Server&EvtSrc=MSSQLServer&EvtID=4064

  • 相关阅读:
    用例图解析
    A B C D类网络地址
    B-树特征
    常用的中间代码
    UML图
    关于文件索引的一道习题
    数据流图的一些原则
    系统总线
    各种排序方法的时间复杂度、空间复杂度和稳定性统计表
    模拟银行自助终端系统
  • 原文地址:https://www.cnblogs.com/zcwvictor-2012/p/3149825.html
Copyright © 2020-2023  润新知