I was recently facing this error when created a SQL Server login and then try login using that newly created login.
Error: Login failed for user. (Microsoft SQL Server, Error 18456) (.Net SqlClient Data Provider)
Please note:
Solution is available on this link, but since microsoft has bad habit of link breaking issue; I have copied and pasted the solution for my reference.
http://support.microsoft.com/kb/555332
Cause:
Scenario 1: The login may be a SQL Server login but the server only accepts Windows Authentication.
Scenario 2: You are trying to connect by using SQL Server Authentication but the login used does not exist on SQL Server.
Scenario 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.
Solution:
Scenario 1: Configure SQL Server in Mixed Authentication Mode.
SQL Server 2012, SQL Server 2008, and SQL Server 2005
- Open SQL Server Management Studio. To do this, click Start, click All Programs, click Microsoft SQL Server 200x (where x is the version of SQL), and then click SQL Server Management Studio.
- Right-click the server, and then click Properties. See image.
- On the Security page, under Server authentication, click the SQL Server and Windows Authentication mode option button, and then click OK. See image.
- In the SQL Server Management Studio dialog box, click OK to restart SQL Server.
For more information, see Choose an authentication mode in SQL Server Books Online.
SQL Server 2000
- Open the Enterprise Manager. To do this, click Start, click All Programs, click Microsoft SQL Server 2000, and then clickSQL Server Enterprise Manager.
- Expand the server group.
- Right-click the server, and then click Properties. See image.
- Click the Security tab. See image.
- Under Authentication, click the SQL Server and Windows option button.
- Restart SQL Server for the change to take effect.
Scenario 2: Verify that the SQL Server login exists
If you are trying to connect to the SQL Server by using SQL Server Authentication, and the server is configured for mixed mode authentication, verify that the SQL Server login exists. For more information, see Create a login in SQL Server Books Online.
Scenario 3: The login may use Windows Authentication but the login is an unrecognized Windows principal.
If you are trying to connect to SQL Server by using Windows Authentication, verify that you are logged in to the correct domain.