net stop mssqlserver
C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Binn\sqlservr.exe /m /f
SQLCMD -A
C:\> C:\>SQLCMD -A 1> ALTER LOGIN sa WITH PASSWORD='qWeR123456'; 2> GO ##然后把sa用户允许登 1> ALTER LOGIN sa ENABLE ; 2> GO
USE [master] GO CREATE LOGIN [admin] WITH PASSWORD=N'admin', DEFAULT_DATABASE=[master], CHECK_EXPIRATION=OFF, CHECK_POLICY=OFF GO ALTER SERVER ROLE [sysadmin] ADD MEMBER [admin] GO
注意:sql server report service和sql serveragent服务 这两个服务需要关掉
本文转载https://blog.csdn.net/yxzone/article/details/121554831