Due to some configuration errors SQL server can lose access to the console. In this article I will describe the steps to provide access to the server for the local administrator SQL
Open services.msc
Stop "SQL Server (MSSQLSERVER)" (or other instance name)
Determinete path where sqlservr.exe e.g. "C:\Program Files\Microsoft SQL Server\MSSQL12.MSSQLSERVER\MSSQL\Binn\sqlservr.exe"
Open cmd.exe
Run sqlcmd.exe and this command
Open services.msc
Stop "SQL Server (MSSQLSERVER)" (or other instance name)
Determinete path where sqlservr.exe e.g. "C:\Program Files\Microsoft SQL Server\MSSQL12.MSSQLSERVER\MSSQL\Binn\sqlservr.exe"
Open cmd.exe
Run SQL with minimum configuration e.g. "C:\Program Files\Microsoft SQL Server\MSSQL12.MSSQLSERVER\MSSQL\Binn\sqlservr.exe" -f
Run sqlcmd.exe and this command
CREATE LOGIN [PCNAME\admin] FROM WINDOWS GO ALTER SERVER ROLE [sysadmin] ADD MEMBER [PCNAME\admin] GOPress CRTL-C in cmd running sqlservr.exe -f, press "Y"
Open services.msc
Start "SQL Server (MSSQLSERVER)" (or other instance name)
No comments:
Post a Comment