Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Confused by SQL Server Express when create a new database

I am an administrator of of my own machine, I have SQL Server Express installed. But when I tried to create a new database I got this error

Create Database permission denied in database 'master'

enter image description here

I figured I was missing 'sysadmin' role for my login. When I tried to add my self as 'sysadmin' I got another error

User does not have permission to perform this action

enter image description here

I am the administrator of this machine, why cannot I have permission to create a new database in this SQL Server Express instance?

Thanks

like image 322
icn Avatar asked Jun 19 '26 01:06

icn


1 Answers

This post may be helpful as well. It points to a script that allows you to add yourself to sysadmin role (provided that you are a local Windows admin).

Update As the link to the actual script is gone, refer to the StackExchange answer on how to take ownership of a SQL Server.

like image 57
Krzysztof Kozielczyk Avatar answered Jun 20 '26 18:06

Krzysztof Kozielczyk



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!