I have installed SQL Server Express 2019 on my machine and after installation, I am able to login into server using the Windows Authentication
method like
And as you can see the sa
account has been disabled by default
So I tried to enable the sa
account like
But I am getting this error message
Cannot alter the login 'sa', because it does not exist or you do not have permission.(Microsoft SQL Server, Error:15151)
Even when I tried to change the server authentication mode from Windows Authentication mode
to SQL Server and Windows Authentication mode
at
I am facing this error!
The EXECUTE permission was denied on the object 'xp_instance_regwrite', database 'mssqlsystemresource', schema 'sys'. (Microsoft SQL Server, Error; 229)
So it looks like I have no/not granted any permission to do any anything! when login with Windows which apparently is my only option to get into server!(this is also happening when I tried to create new user!)
Can you please let me know what I am doing wrong and how I can handle this to act as an administrator for DB when I login?
I have already seen and tried this post, so please kindly, if you are not sure about the solution do not close, down vote or redirect me again to this post?
CodePudding user response:
This is poor practice in the first place. If you need a local admin account you should create a different login such that attackers and automated tools won't be able to just assume the user name.
But remember: I said, "If". You can get admin/sa rights to administer the server (or create your initial local login) by logging into the computer (not the database) with the local administrator
account. Then you can use using Windows Authentication from that account to access the database server as a server administrator.