When SQL Server attaches a database, the following error occurs: The physical file cannot be opened. If the operating system is incorrect, a graphic tutorial is provided.
Problem description:
When attaching data, the system prompts that the physical file cannot be opened. Operating System Error 5. For example:
Cause: it may be a problem with file access permissions.
Solution: Find the mdf and ldf files of the database and grant permissions. For example:
Find the mdf and ldf files. This example uses ldf as an example.
1. Right-click the file and choose Properties> Security> Edit
2. Edit --> Add
3. Add --> advanced
4. Advanced --> Search now --> Find in search results --> Everyone --> OK
5. Confirm --> the selected Everyone user by default --> Everyone Permissions --> if you select "full control", all the unselected items below are checked by default.
--> OK --> OK. That is, the permissions of Everyone are completed.
The above is an example of how to add a database to SQL Server. If an error occurs, the physical file cannot be opened. If the operating system is incorrect, a graphic solution is provided, if you have any questions, please leave a message and the editor will reply to you in time. Thank you very much for your support for the help House website!