Error: 1474, Severity: 16, State: 1. Select all Open in new window. On server B, I am getting the following errors: The mirroring connection to 'TCP://serverA:5022' has timed out for database 'DB' after 10 seconds without a response. Check the service and network connections. Error: 1479, Severity: 16, State: 1. Select all Open in new window. Error: 1474, Severity: 16, State: 1. – Learn more on the SQLServerCentral forums. Pinal Dave is a SQL Server Performance Tuning Expert and an independent consultant. He has authored 12 SQL Server database books, 35 Pluralsight courses and has written over 5200 articles on the database technology on his blog at a Along with 17+ years of hands-on experience, he holds a Masters of Science degree and a number of database certifications. A versatile writer with the vast knowledge of technology helps to reduce the gap between a user and technology. Provides easy and reliable ways to resolve multiple technical issues, which users encounter in their day-to-day life.
After you install Microsoft SQL Server 2016/2014/2012/2008/2005/2000, and you try to connect to server that is running SQL Server, probably you receive one of following error messages.
- Login failed for user '<user_name>'. The user is not associated with a trusted SQL Server connection. (Microsoft SQL Server, Error: 18452)
- Login failed for user '<user_name>'. (Microsoft SQL Server, Error: 18456)
- Cannot open user default database. (Microsoft SQL Server, Error: 4064/4062)
However, what lead to these errors occurring? Now let's learn to check these login failed error details and fix them in this article.
Section 1: Check the Error State or Find Reason to This Error
While you receive error 18456/18452 message, please check error state in SQL Server error log.
Msg 18456, Level 14, State 1, Server <server name>, Line 1
Login failed for user '<user name>' Usr local bin virtualenvwrapper.sh no such file or directory.
Login failed for user '<user name>' Usr local bin virtualenvwrapper.sh no such file or directory.
We should know that the 'State' will always be shown to be '1' regardless of the nature of the problem. To determine the true reason for the SQL Server login failure, the administrator can look in server's error log where a corresponding entry will be written.
View the entry and just need to pay attention to the 'State', which the server will accurately set to reflect the source of the problem. Refer to common error states and their descriptions in following table, you would find the real reason for failed logining SQL Server.
ERROR DESCRIPTION |
Invalid userid |
Attempt to use a Windows login name |
Login disabled and password mismatch |
Password mismatch |
Invalid password |
Valid login but server access failure |
SQL Server service paused |
Change password required |
While you receive SQL Server failed login error 4062/4064, you should look for reason why cannot open default database.
As is known, each user has a default database. And it is used automatically when you connect to computer that is running Microsoft SQL Server, and you do not specify a login database. However, if it is unavailable when connected, you may not be able to connect. Instead, you receive error 4062/4064 message.
Default database becomes unavailable probably because the database:
- 1. No longer exists, offline or has been detached.
- 2. Has been set to the RESTRICTED_USER state or is set to emergency status.
- 3. Is in suspect mode, or is in single user mode but the only available connection is already being used by someone else or by something else.
Section 2: Fix SQL Server Login Failed Error
Case 1: Fix SQL Server login failed error 18456/18452
'Login failed for user' would occur if the user tries to login with credentials without being validated. Now we will introduce some situations when there is no user credentials for SQL Server logon and how to solve SQL Server login problem.
Situation 1: The login may be a SQL Server login but the server only accepts Windows Authentication.
To login SQL Server successfully, you should change to login SQL Server with Windows Authentication mode and enable Mixed Authentication mode or SQL Server Authentication mode.
Situation 2: You are trying to connect by using SQL Server Authentication but the login used does not exist on SQL Server.
Sql Server Error 1474 State 1017
In order to make SQL Server login with user, please confirm that you have a login user. If not, create new login in SQL Server Books Online.
Situation 3: The login may use Windows Authentication but the login is an unrecognized Windows principal.
An unrecognized Windows principal means that Windows can't verify the login. This might be because the Windows login is from an untrusted domain. To resolve this issue, verify that you are logged in to the correct domain.
Sql Server Error 1474 State 171
Situation 4: The login user password is valid or incorrect, or the password is changed.
If it is just because of user password incorrect or invalid, you can reset user password with SQL Password Genius, and then login SQL Server with new password again.
Situation 5: The login is disabled.
You should need to enable SQL Server login user or enable SQL Server authentication mode after connecting to server with Windows authentication mode. Microsoft visio for mac cracked.
Situation 6: The login is valid but server access is failed.
Probably you have no admin privileges to server, or Windows Firewall has not allowed SQL Server access. So you can try to get administrator rights or configure Windows Firewall to allow SQL Server access.
Case 2: Fix SQL Server login failed error 4062/4064
To fix SQL Server login error 4062/4064, please specify an available, valid database as user's default database. So while default database is connected automatically, successful connection can be guaranteed.
Does west marine sell fishing licenses. Recognizing this profound truth, West Marine offers an outstanding selection of fishing gear. Whether your passion is casting chug bugs on the Chesapeake, kite fishing in the Keys or stalking trophy largemouth bass, we are here to help with boating’s best selection of fishing gear—and with local expertise to match.
Step 1: Run Command Prompt as administrator.
Step 2: Set default database for login user by one of following methods.
2-1 If SQL Server login uses Windows authentication mode, run command below and press Enter.
sqlcmd –E -S InstanceName –d master
sqlcmd –E -S InstanceName –d master
2-2 If SQL Server login uses SQL Server authentication to connect to instance, run command below.
sqlcmd -S InstanceName -d master -U SQLLogin -P Password
sqlcmd -S InstanceName -d master -U SQLLogin -P Password
Step 3: At the sqlcmd prompt, type the following, and then press ENTER.
ALTER LOGIN SQLLogin WITH DEFAULT_DATABASE = AvailDBName
Step 4: At the sqlcmd prompt, type GO, and then press ENTER.
Related Articles: