This blog is powered by subText which runs MS SQL database in the back, which also requires me to remote manage the database from time to time when something need to be tweaked behind the scene.Â But recently, I was having trouble logging in through Microsoft SQL Server Management Studio.Â The login attempt was rejected due to the following reason.
Cannot open user default database. Login failed.
Login failed for user â€˜UserName’. (Microsoft SQL Server, Error: 4064)
My first thought is where my default database gone.Â I used to have two DB associated in my account with the one that powers this blog as default.Â But recently the hosting company, Webhost4Life, decided to bump the space to 100G while reducing the number of MS DB allowed in my package to one per account.Â For that reason, I guess they may have massed up with user’s default database setting while making these changes.Â So I filed a support ticket asking why it happened and they responded promptly but instead of simply reset the default database for me they pointed me to this post over on sqlauthority.com, which helped me to solve this issue.Â Credit goes to Pinal Dave though.
Here is the fix in short:
First of all, you need to change the connect to database to something other than <default>, like master.Â You need to click Option button on the login window to get the Connection Properties tab to show up.
Then,Â once you log in, open a new query and run the following script to reset the default database to your account.Â Make sure to fill up the [test] and master with the right value.
ALTER LOGIN [test] WITH DEFAULT_DATABASE = master
That’s it.Â Mystery was solved.
7 thoughts on “Cannot Open User Default Database”
I don’t know what to say except that I have enjoyed reading. Nice blog. I will keep visiting this blog very often.
Asking questions are actually nice thing if you are not understanding anything
totally, but this piece of writing gives nice understanding yet.
Hey there, You’ve done an excellent job.
I will certainly digg it and personally recommend to my friends.
I am sure they will be benefited from this
This exercise really challenges the ab muscles,
which means you must take into account the career of one’s lower back.
It does not matters the way the child was created whether normal birth or operated.
Research found that for every hour you’re working out your system can make $10,000 price of
beneficial chemicals that it needs.
Antioxidants – These promote the fitness of
our cells, may help prevent cancer which enable it to slow the aging process.
Recent surveys demonstrate that the volume of people
deriving their required body nutrients away from these various
food bars is increasing rapidly. Another food choice you could select, acquire the best choices to keep toddler healthy is baby
Underneath line is the fact that there is nobody tactic that’s planning to give you tested prediction rights to the game.
Thanks for sharing your thoughts about customization. Regards