I've performed a fresh install of SQL Server 2012 on my local development PC. I've done this before and it has worked, however this time I'm getting the following error message when I attempt to sign into SQL Server.
"Login failed for user xxxxxxxxxx (Microsoft SQL Server, Error: 18456)"
How can I access my local instance of SQL Server? I'm rather ignorant about SQL Server security.
Best Answer
Since you have access to the machine itself, you can follow the instructions here to (re)add yourself as a sysadmin: https://docs.microsoft.com/en-us/sql/database-engine/configure-windows/connect-to-sql-server-when-system-administrators-are-locked-out
The short version of what that says is:
-m
sqlcmd -S {your machine name or localhost}
CREATE LOGIN [Domain\LoginName] FROM WINDOWS;
EXEC sp_addsrvrolemember '[Domain\LoginName]', 'sysadmin';