Friday, January 24, 2014

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



SQL Server Error:

TITLE: Connect to Server
------------------------------

Cannot connect to * (Server Name).

------------------------------
ADDITIONAL INFORMATION:

Cannot open user default database. Login failed.
Login failed for user '*'. (Microsoft SQL Server, Error: 4064)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft%20SQL%20Server&EvtSrc=MSSQLServer&EvtID=4064&LinkId=20476

------------------------------
BUTTONS:

OK
------------------------------















Resolution:

Make sure user has permission on the default database, which is generally "master" database. if you are creating a user with public role on SQL Server as assigning appropriate permissions on the individual database, make sure to assign default database as master. 

Now go the option on the SQL client connection screen as shown below and click on options.































Now change the "connect to database" as master or the database that you have assigned as default database on the SQL server you are connecting too. 






























Now click on  connect and you should be able to successfully connect with your SQL Server.

3 comments: