I have Sql Server 2017 and the Data folder is the default at C:\Program Files\Microsoft SQL Server\MSSQL14.SQLEXPRESS\MSSQL
. The access rights on the folder are:
I have an old database with its MDF file in My SQL Database
. I tried to duplicate the same rights to My SQL Database
:
I couldn't duplicate those for ALL APPLICATION PACKAGES as I don't know who it is.
With the above rights on My SQL Database
I couldn't reattach a database from its MDF file in that folder. It keeps saying Operating system error 5: "5(Access is denied.)"
on the MDF file.
What access permissions are required to have database files in another folder other than the default?
2条答案
按热度按时间zf9nrax11#
Execute the following
SELECT
:And check the value of
service_account
for theservicename
thatsSQL SERVER
:Then make sure that the folder and the files have the proper access rights for that account.
uujelgoq2#
Add your user account in Advanced Security Setting of the Data folder with Full Control access