开发者

SQL Server attaching database: access denied [duplicate]

开发者 https://www.devze.com 2023-02-03 12:13 出处:网络
This question already has answers here: Access is denied when attaching a database (31 answers) Closed 8 years ago.
This question already has answers here: Access is denied when attaching a database (31 answers) Closed 8 years ago.

I had created a MDF database file and I just recently reformatted my computer. When I go to attach the database file to SQL Server, I get an "access is denied" error. I looked online and found that others have had a similar problem that was solved by running SQL server as administrator but that didn't work for me. I'm using Windows authenticate, if that helps to understand th开发者_StackOverflow社区e problem.

I'm locked out!

Thanks.


Add your user account to the System Administrator role. I suspect your account does not have the necessary permissions.


the service account- that SQL Server runs as-- must have permissions to get to the location where you have your MDF file.

for example, if you have your MDF file in the C:\SqlDatabases\ folder.. you need to make sure that the service account (the service that SQL Server runs as) has permissions to read and write to this directory.

0

精彩评论

暂无评论...
验证码 换一张
取 消