本来想删数据库,然后用备份恢复一下。删了后发现无法登陆。然后就修改了登陆选项中的登陆数据库为master,可以登录上去,但是无法进行恢复数据库的操作。
找到了这篇文章:
http://blog.youkuaiyun.com/JimFire/archive/2009/12/29/5096633.aspx
关键是这个:
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