Access SQL Server From Backend 1654356755
Access SQL Server From Backend 1654356755
SQL server was installed long back and managed by other team. Server owners moved other organization and
forgot to provide\handover SA password. Recently client suggested that add instance to DBA inventory for
support. There is no access on SQL server DBA team and don’t know the SA password & connection string also.
We done below steps to get access SQL server from back end and communicated to client, SQL services will
restart during the activity (5 minutes) and started activity in non-business hours.
Resolution:
1
SQLCMD –S . or SQLCMD –S ServerName (for default instance)
USE [master]
GO
CREATE LOGIN [Domain\Loginname] FROM WINDOWS WITH DEFAULT_DATABASE=[master]
GO
ALTER SERVER ROLE [sysadmin] ADD MEMBER [Domain\Loginname]
GO
b. SQL user
USE [master]
GO
CREATE LOGIN [Test] WITH PASSWORD=N'XXXXXXXX' MUST_CHANGE, DEFAULT_DATABASE=[master],
CHECK_EXPIRATION=ON, CHECK_POLICY=ON
GO
ALTER SERVER ROLE [sysadmin] ADD MEMBER [Test]
GO
exit
2
5. Start SQL Server in Multi-user mode.
a. Open SQL server configuration manager
b. Right click on SQL server-> property ->Advanced-> startup parameter-> select “-mSQLCMD”-> click Remove
-> Apply->Ok