Setting SQL Auth in SQLExpress
SSMS
Insert screenshot later
CLI
- Login to the the SQLExpress instance with your Windows credentials:
sqlcmd /S fortify-wi-test\sqlexpress /E
-
Enable sa account
sqlcmd ALTER LOGIN [sa] WITH PASSWORD='SAPassword', CHECK_POLICY=OFF GO ALTER LOGIN [sa] ENABLE GO
-
Enable Mixed Mode Authentication (1 = Windows Auth only, 2 = Mixed Mode):
sqlcmd USE [master] GO EXEC xp_instance_regwrite N'HKEY_LOCAL_MACHINE', N'Software\Microsoft\MSSQLServer\MSSQLServer', N'LoginMode', REG_DWORD, 2 GO
-
Exit SQL Connection
exit
- Restart SQLExpress instance
net stop MSSQL$SQLEXPRESS
followed bynet start MSSQL$SQLEXPRESS
- Login with your sa account to verify
sqlcmd /S .\sqlexpress -U sa -P SAPassword
- Another way to verify is to execute the following command (1 = Windows Auth only, 0 = Mixed Mode)
SELECT SERVERPROPERTY('IsIntegratedSecurityOnly');