-
Written By Rohit Singh
-
Published on July 31st, 2020
-
Updated on November 1, 2021
Summary: Many users fail to log in to their Microsoft SQL server. This may be due to the Microsoft SQL server 4064 error – “Cannot open user default database login failed”. Errors are unavoidable as this can break the workflow of any company. So, if you are getting the same error then you land on the right page. Today in this blog we’ll get to know the process to fix error 4064.
Error Message: Cannot open user default database. Login failed.
Each error of the SQL server is identified by a number and the error message mentioned above occurs when a user tries to connect to an instance of SQL Server. The message is identified as SQL error 4064.
Hence, there may be many possibilities that it has been set to RESTRICTED_USER state or has been left detached. Some other reasons that can probably cause this error are:
So, now we have discussed the reasons by which you probably get an error as the server login failed. Now we’ll get to know about the process to fix this SQL server error 4064 login failed error. There may be chances that you may face SQL Database Error 8921 sometimes.
If you want to fix error “Cannot open user default database login failed” follow these different methods that will help you to fix error on the different server environment, to fix the users’ database that is available for a connection.
For SQL version 2000 and 7.0 – OSQL utility can be used to change the default database. If you want to recover using the OSQL utility, follow the below commands..
In SQL Server 2005 and for the version after 2005, use – SQLCMD utility to change default database. Following are the steps for the process:
Step1 – Open Command Prompt.
Step2 – As per Windows and SQL server authentication there are two different commands, choose accordingly:
Step3 – Type the following command in sqlcmd prompt in “ALTER LOGIN SQLLogin WITH DEFAULT_DATABASE = AvailDBName” and then press Enter.
Step4 – Then at ‘sqlcmd prompt’, type GO and press Enter.
You can take the help of professional third-party tools to fix Microsoft SQL Server login failed error 4046. With the help of SQL Database Recovery Tool, users can recover both MDF and NDF files in SQL server. Also, this utility is a one-stop solution to recover all versions of MS SQL servers like 2000, 2005, 2008, 2012, 2014, and 2016. Try utility, if you want to make the repairing process faster and easier.
In this blog, we have covered the reasons and the process to fix the Microsoft SQL Server 4064 Error Login Failed. But it is seen that users generally find these methods quite lengthy to follow. So, to make that process very simple and secure you will take the help of third-party tools to fix this issue.
About The Author:
Rohit Singh is an Email Backup, Recovery & Migration Consultant and is associated with Software Company from the last 3 years. He writes technical updates and their features related to MS Outlook, Exchange Server, Office 365, and many other Email Clients & Servers.
Related Post