MC, 11:28 poniedziałek, 20.04.2015 r.
Ilustracja do artykułu: Sql Server - Solved:

Sql Server - Solved: "Cannot open user default database. Login failed."

Short note describing the way to resolve a problem: Cannot open user default database. Login failed. Login failed for user ‘UserName’. (Microsoft SQL Server, Error: 4064).

When the problem occurs?

According to the error description SSMS is unable to open default database for specified user while logging in. In my case this default database simply was not existing any more. What can we do now?

How to resolve the problem?

Luckily for us it is not difficult to fix this problem. We can just change the database to connect on "Connect to Server" window. The master database will be appropriate:
  • At the bottom of the window the Options>> button is placed. It will show you the "Connection Properties" tab
  • Then we need to change value of Connect to database field from <default> to master
  • Finally click Connect button

In fact that's all about the problem described at the beginning of this article. We can also permanently change the default database assigned to the user, however it will be an issue of the one of further notes.

Komentarze (0) - Nikt jeszcze nie komentował - bądź pierwszy!

Polish version: Sql Server - Rozwiązanie problemu: "Cannot open user default database. Login failed."