Event ID - 4064

Event Id4064
SourceMSSQLServer
DescriptionCannot open user default database. Login failed.
Event Information"According to Microsoft

Cause:
When a client connects to a SQL Server instance without specifying a database context, the default database defined for its login is used. If that database is unavailable for any reason, the above message appears.
Note: If the login is a member of one or more Windows groups that are also defined as logins within SQL Server, the default database for one of those groups may be used. There is not a reliable way to predict which of the default databases will be chosen during a login attempt. Therefore it is important to check group membership for the login account and then check the default database set for all groups to see that they are all available.
Resolution:
You need to either make the default database accessible or avoid using that particular database. Your options include:
1.Change your connection string to always specify a particular database.
2.Verify that the default database defined for each login still exists and is accessible. Review the SQL Server error log to help determine why a particular database is not accessible.
3.Use a tool such as OSQL to specify a particular database during the initial connection. Once you are connected, execute sp_defaultdb to change the default database for your login to a database that is currently accessible.
4.Log in with an account that is a member of the syadmin or securityadmin fixed server roles, and execute sp_defaultdb to change the default database for the failing login to an accessible database.
For more information about default databases, see ""sp_defaultdb"" in Books Online and the Microsoft Knowledge Base articles 307864 and 196076."
Reference LinksEvent Id:4064 of Source Id:MSSQLServer

Catch threats immediately

We work side-by-side with you to rapidly detect cyberthreats
and thwart attacks before they cause damage.

See what we caught

Did this information help you to resolve the problem?

Yes: My problem was resolved.
No: The information was not helpful / Partially helpful.