Just installed SQL Server Management Studio with Tools including LocalDB. Went through entire setup without ever seeing an option to set the sa password nor setup any other users/logins with sysadmin rights. So now I can’t actually do anything in SSMS. Permission is denied to create new database, change the sa password, etc. Pretty useless until I can either log in as sa or setup my user with sysadmin rights. What am I missing here?
Just installed SQL Server Management Studio with Tools including LocalDB. Went through entire setup
Share
During setup you should have seen a screen that offered you to choose mixed authentication for the database engine and also add Windows users to the sysadmin server role. Here’s what it looked like:
Chances are you blew past it clicking Next > Next > Next. It’s ok, we’ve all done that.
The easiest fix, I think, is to connect using SSMS via PSExec.exe. This will allow you to connect as
NT AUTHORITY\SYSTEM, which has inherent sysadmin rights to SQL Server. You launch it with these options:This will run SSMS as NT AUTHORITY\SYSTEM using Windows Auth. You will be prompted to connect to a server, just enter
.\SQLEXPRESS(make sure the service is running):Then you can right-click your instance and change the authentication mode to mixed (Properties > Security), reset the sa password under Security > Logins, and add your Windows login as a sysadmin.
You can also see this answer if that doesn’t get you everything:
https://stackoverflow.com/a/12164306/61305