SQL Server attaching database: access denied [duplicate]
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.
精彩评论