Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sql Server - Fixing Error Error: 18456, Severity: 14, State: 11

Tags:

sql-server

I'm trying to login to a SQL Server instance from the server it runs on while remoted in as myself.

I keep getting the standard login failed error and in the error log I'm seeing "Error: 18456, Severity: 14, State: 11."

The login is using windows authentication - here's the weird bit. I can login fine from my own machine using the same authentication, just not when I'm on the machine the database is installed on.

Any ideas?

Thanks, Dave

like image 352
Comanighttrain Avatar asked Dec 11 '12 13:12

Comanighttrain


People also ask

Could not find a login matching the name provided Error 18456 Severity 14 State 5?

Reason: Could not find a login matching the name provided. The login (whether using SQL or Windows Authentication) does not exist. For Windows Auth, it likely means that the login hasn't explicitly been given access to SQL Server – which may mean it is not a member of an appropriate domain group.

What does SQL Server error 18456 mean?

The generic message “Login Failed for User (Microsoft SQL Server, Error: 18456)” means you entered invalid credentials when logging into SQL Server.

How do I enable Windows Authentication in SQL Server 2014?

2.3 Enabling SQL Authentication or Mixed Authentication Right-click the server you wish to modify and then click Properties. Select the Security Page. Under the Server authentication heading choose either the desired authentication: Windows Authentication or SQL Server and Windows Authentication mode. Click OK.


1 Answers

How does UAC work?

When an administrator logs on, this version of Windows creates two separate access tokens for the user: a standard user access token and an administrator access token. The standard user access token contains the same user-specific information as the administrator access token, but the administrative Windows privileges and SIDs have been removed. The standard user access token is used to start applications...

When you're logged in locally your administrator token is stripped. Since you granted access to your instance to BUILTIN\Administrators, you are locked out of the instance. When authenticating remotely the administrator token is preserved and you gain access. You would gain access if you'd choose to RunAs\Administrator when starting your application (SSMS?).

The solution is to grant yourself access explicitly:

create login [domain\you] from windows;
exec sp_addsrvrolemember 'domain\you','sysadmin';
like image 200
Remus Rusanu Avatar answered Sep 30 '22 16:09

Remus Rusanu