An attempt to login using SQL authentication failed. Server is configured for windows authentication - sql-server

One of our SQL servers is configured to use both Windows and SQL Authentication, however, we are seeing the continues error "An attempt to login using SQL authentication failed. Server is configured for Windows authentication" in the log. From SQL Management studio we are able to access the server using the same user credentials using SQL Authentication but when one of the applications is using the same user credentials to connect to the SQL server then we are getting the same error.

You may need to restart the SQL Engine Service for the change to be applied. Whoever changed the authentication may not have restarted the service.

Related

Connection issues when trying to connect to a SQL Server database

I'm trying to connect to a remote SQL Server database. It's being hosted on another server within the network at my workplace, but I keep getting an error when trying to connect while being logged in under a specific Windows (AD) account.
I'm using SQL Server Management Studio from my local server. I tried logging in with account "x". When specifying the connection string I'm using a SQL Server authenticated user. This is when I get the error below:
I logged in with a different account "y" to the server and attempted the database connection again (with the same SQL Server authenticated user), and it worked.
Why would I be able to connect under one Windows account and not the other (from the same server) when I'm trying to connect with a SQL Server authenticated user?
Could this be that the Windows account is not part of the correct administrator group?
Any thoughts or insights are appreciated.
Thank you,

Error 18456 loggin on a SQL Server 2016

I had an unexpected system crash and had to setup SQL Server 2016 again. I can connect to the server from SSMS if I use a Windows authentication account, but not via any login created. I keep getting an error 18456:
Login failed for user 'sa'
Steps:
I have enabled SA login and gave it a password but cannot connect via SSMS
I have created another login and matched it to my project database, the project database now has the login under its users but again, I cannot log in.
SSMS is installed on the actual db server so I doubt this is a remote login issue, but as the db server is isolated from the actual site I would like to update this if needed.
Any ideas would greatly be appreciated!
Did you enable the mixed mode authentication?
Did you restart SQL services after changing the mixed mode authentication?
Some of the server level properties takes only after a SQL restart , one such is authentication modes.
Usually a SQL Service problem.
Start - > View Local Services -> SQL Server(SQLEXPRESS) > restart it

Cannot connect to SQL server from workstation - Microsoft SQL Server 2008 R2 (SP2)

I face the following isuse on a Microsoft SQL Server 2008 R2 (SP2):
Login failed for user ''. Reason: An attempt to login using SQL authentication failed. Server is configured for Windows authentication only.
My SQL server has mixed mode enabled (i verified and switch it on and off several times)
I am able to loging from a peer server which is a replica with the same windows accounts
I am unable to loging from a Windows workstation
The DSN configuration in Windows is succesful though
If mixed mode is enabled why would the server tell me it is not?
What could cause the server to believe it is Win authentication only although the setup is mixed mode?
Wireshark did not help.
I traced back the changes on the server it appears that the main administrator user was renamed. A new sys admin user was created and I had to add this user in both Windows SQL Security groups.

SQL Server Windows Authentication

I'm trying to connect to a remote SQL Server Express machine using Windows authentication.
I´m logged on with a user with username Administrator, but when logging in, I get the error message:
Login failed for user guest ...
Why is not using the Administrator account?
Thanks in advance.
For Windows Authentication to work, the target machine has to be on a domain where your Windows credentials will be recognized. If the server is outside of your organization's control, it will not recognize your credentials and you will have to use a Sql Server user ID and password to log in.
SQL Server Express by default only allows local connections - you can enable it, but you have to explicitly do so.
See these:
SQL Server Express team blog: how to enable Express to accept remote connections.
How to enable Remote Connection on SQL Server 2008 Express

Windows authentication trusted connection not working

MSSQL Server is in the "abc" domain and have mixed mode authentication.
I am connecting from the machine which is not in domain or in a domain "xyz" but with in the same network using MSSQL Jdbc driver 2.0. I have logged in as admin or account in xyz domain.
It works fine using following url for connection for "sa" or SQL Mode Authentication.
jdbc:sqlserver://%DB_IP%:%DB_PORT%;SelectMethod=cursor;DatabaseName=dbname
It doesn't work For window authentication using credential "MSSQLDomain\username" i.e "abc\username", using following url
jdbc:sqlserver://%DB_IP%:%DB_PORT%;SelectMethod=cursor;integratedSecurity=true;DatabaseName=dbname;
Gives following error.
Login failed for user ''. The user is not associated with a trusted
SQL Server connection.
I have tried adding property Trusted_Connection=Yes to url, but still gives same error.
I don't want to map the drive of the SQL Server. I am able to access the any shared folder of the SQL Server Machine by providing "MSSQLDomain\username" and password.
It works fine for both authentication mode, if both machine is in same domain.
If I am using jtDS Driver from the machine which is not in domain or in "xyz" domain within same network i.e same subnet, it works fine.
This is the deliberate and correct behaviour of Windows Authentication.
It is because the Domain from which you are connecting from, is not the same Windows Domain as the one where your SQL Server instance resides.
I believe there are methods for bridging the Domains so to speak, however they require custom and tricky implementation. You also will have to configure a trust relationship between the domains.
The following thread contains discussions which you will likely find useful.
http://sql-server-performance.com/Community/forums/p/24601/137574.aspx
Changing the login credentials might help,
use SQL authentication instead of nt authentication
https://support.microsoft.com/en-us/kb/555332
Symptoms
After you install Microsoft SQL Server 2014, SQL Server 2012, SQL Server 2008, SQL Server 2005, or SQL Server 2000 and you try to connect to the server that is running SQL Server, you receive one of the following error messages:
Login failed for user '%.*ls'. The login is a SQL Server login and cannot be used with Windows Authentication.%.*ls
Login failed for user ''. The user is not associated with a trusted SQL Server connection. (Microsoft SQL Server, Error: 18452)
Login failed for user ''. (Microsoft SQL Server, Error: 18456)
Resolution
This problem occurs if the user tries to log in with credentials that cannot be validated. This problem can occur in the following scenarios:
Scenario 1:
The login may be a SQL Server login but the server only accepts Windows Authentication
To resolve this issue, configure SQL Server in Mixed Authentication Mode.
Scenario 2:
You are trying to connect by using SQL Server Authentication but the login used does not exist on SQL Server
To resolve this issue, 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
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.
I have been involved with making a SQL server connection cross to domains like that, and it is exceptionally painful. In order to use credentials from another domain, the domain where you are assigning the permissions has to trust the domain, where the account is coming from. IT Pro's are generally VERY reluctant to trust another domain in this manner, and for good reason, so if this trust relationship has not been established it might not be very likely to convince the admins to do this.
Once you have the trust relationship established, you will probably need to register the SPN's for your SQL server in Active Directory, and assign delegation permissions. This type of environment is very difficult to setup, troubleshoot and maintain.
I hope that there is some other way that you can do this, because it sounds like you are headed for a very difficult scenario.
Hope it helps
Rihan

Resources