{"id":132598,"date":"2023-04-26T06:08:29","date_gmt":"2023-04-26T06:08:29","guid":{"rendered":"https:\/\/www.stellarinfo.com\/blog\/?p=132598"},"modified":"2025-02-04T05:51:31","modified_gmt":"2025-02-04T05:51:31","slug":"fix-operating-system-error-5-access-is-denied-in-ms-sql-server","status":"publish","type":"post","link":"https:\/\/www.stellarinfo.com\/blog\/fix-operating-system-error-5-access-is-denied-in-ms-sql-server","title":{"rendered":"How to Fix Operating System Error 5: (Access is Denied) in MS SQL Server?"},"content":{"rendered":"<?xml encoding=\"utf-8\" ?><?xml encoding=\"utf-8\" ?><p>You may encounter the error &ldquo;Operating system error 5: Access is denied&rdquo; while restoring backup, creating backup, or accessing\/creating the database in SQL Server. The error occurs when the SQL Server fails to read the file you are attempting to access. The complete error message looks like this:<\/p><p><strong>Msg 5120, Level 16, State 101, Line 1<\/strong><\/p><p><strong>Unable to open the physical file &ldquo;R:\\productions\\stellar_database.mdf&rdquo;. Operating system error 5: &ldquo;5(Access is denied.)&rdquo;.<\/strong><\/p><p><strong>Msg 1802, Level 16, State 7, Line 1<\/strong><\/p><p><strong>CREATE DATABASE failed. Some file names listed could not be created. Check related errors.<\/strong><\/p><p>This error prevents you from accessing the SQL database or backup file. Below, we will see the reasons that can lead to such an error and see how to fix it.<\/p><h2 class=\"wp-block-heading\" id=\"causes-of-the-operating-system-error-5:-5-(access-is-denied)-in-sql-server\">Causes of the Operating System Error 5: 5 (Access is denied) in SQL Server<\/h2><p>The &ldquo;Access is denied&rdquo; error in SQL may occur due to the following reasons:<\/p><ul class=\"wp-block-list\">\n<li>Using the incorrect path of the backup file while restoring backup.<\/li>\n\n\n\n<li>SQL Server database engine service account does not have permissions to read\/write the folder where your backup file is saved.<\/li>\n\n\n\n<li>Issue with the backup file or incorrect backup file.<\/li>\n\n\n\n<li>Not running SSMS with Administrator permissions.<\/li>\n\n\n\n<li>Database (MDF\/NDF) file is corrupted.<\/li>\n\n\n\n<li>Backup file is not in a compatible format.<\/li>\n<\/ul><h2 class=\"wp-block-heading\" id=\"solutions-to-fix-the-error-&ldquo;operating-system-error-5:-5(access-is-denied)-in-sql-server\"><strong>Solutions to Fix the Error &ldquo;Operating System Error 5: 5(Access is denied) in SQL Server<\/strong><\/h2><p>The error &ldquo;Access is denied&rdquo; in SQL Server can occur if there is some issue with the backup file you&rsquo;re trying to access. Check whether you have selected the correct backup file with correct name. Sometimes, simply changing the backup file location can fix this error. You can also try changing the location of the file. If the error persists, then follow the below solutions to resolve this SQL Server error.<\/p><h3 class=\"wp-block-heading\">Solution 1: Check the File and Folder Path<\/h3><p>You can get the Operating system error 5: &lsquo;5(Access is denied)&rsquo; in SQL Server, if there is an issue with the backup file path &ndash; either the path does not exist or it is not valid. Make sure the backup file path is correct and accessible from the SQL Server instance. If you&rsquo;re using the T-SQL command to restore the backup, then check if you&rsquo;ve entered the correct backup file path in the query.<\/p><h3 class=\"wp-block-heading\" id=\"h-1-check-and-grant-the-required-permissions\">Solution 2: Check and Grant the Required Permissions<\/h3><p>If you don&rsquo;t have sufficient permissions on the folder where your backup file is saved, then you may not able to access or restore the backup file and encounter the error. You can check and provide the right permissions to fix the issue. Here&rsquo;s how to do so:<\/p><ul class=\"wp-block-list\">\n<li>Go to the location on your system where the production folder (containing the backup file) is stored, right-click the folder, and select&nbsp;<strong>Properties<\/strong>.<\/li>\n<\/ul><figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"574\" height=\"105\" src=\"https:\/\/www.stellarinfo.com\/blog\/wp-content\/uploads\/2023\/04\/click-properties.png\" alt=\"Click Properties\" class=\"wp-image-176776 apply-gradient-on-post-images\" srcset=\"https:\/\/www.stellarinfo.com\/blog\/wp-content\/uploads\/2023\/04\/click-properties.png 574w, https:\/\/www.stellarinfo.com\/blog\/wp-content\/uploads\/2023\/04\/click-properties-300x55.png 300w, https:\/\/www.stellarinfo.com\/blog\/wp-content\/uploads\/2023\/04\/click-properties-150x27.png 150w\" sizes=\"auto, (max-width: 574px) 100vw, 574px\" \/><\/figure><ul class=\"wp-block-list\">\n<li>Verify if the user trying to restore the backup file has permissions to access the folder.<\/li>\n<\/ul><figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"543\" height=\"734\" src=\"https:\/\/www.stellarinfo.com\/blog\/wp-content\/uploads\/2023\/04\/verify-file-permissions.png\" alt=\"verify File Permissions\" class=\"wp-image-176777 apply-gradient-on-post-images\" srcset=\"https:\/\/www.stellarinfo.com\/blog\/wp-content\/uploads\/2023\/04\/verify-file-permissions.png 543w, https:\/\/www.stellarinfo.com\/blog\/wp-content\/uploads\/2023\/04\/verify-file-permissions-222x300.png 222w, https:\/\/www.stellarinfo.com\/blog\/wp-content\/uploads\/2023\/04\/verify-file-permissions-150x203.png 150w\" sizes=\"auto, (max-width: 543px) 100vw, 543px\" \/><\/figure><ul class=\"wp-block-list\">\n<li>If not, click on the&nbsp;<strong>Edit<\/strong>&nbsp;button. If the user is not in the list, click the&nbsp;<strong>Add<\/strong>&nbsp;button to add the user.<\/li>\n<\/ul><figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"543\" height=\"687\" src=\"https:\/\/www.stellarinfo.com\/blog\/wp-content\/uploads\/2023\/04\/click-add-button-to-add-user.png\" alt=\"click Add button to add user\" class=\"wp-image-176779 apply-gradient-on-post-images\" srcset=\"https:\/\/www.stellarinfo.com\/blog\/wp-content\/uploads\/2023\/04\/click-add-button-to-add-user.png 543w, https:\/\/www.stellarinfo.com\/blog\/wp-content\/uploads\/2023\/04\/click-add-button-to-add-user-237x300.png 237w, https:\/\/www.stellarinfo.com\/blog\/wp-content\/uploads\/2023\/04\/click-add-button-to-add-user-150x190.png 150w\" sizes=\"auto, (max-width: 543px) 100vw, 543px\" \/><\/figure><ul class=\"wp-block-list\">\n<li>You can enter the object name. You can use the <strong>Check Names<\/strong> option to verify if you entered it correctly.<\/li>\n<\/ul><figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"684\" height=\"384\" src=\"https:\/\/www.stellarinfo.com\/blog\/wp-content\/uploads\/2023\/04\/use-check-names-option-to-verify-object-name.png\" alt=\"Use check names option to verify object name\" class=\"wp-image-176780 apply-gradient-on-post-images\" srcset=\"https:\/\/www.stellarinfo.com\/blog\/wp-content\/uploads\/2023\/04\/use-check-names-option-to-verify-object-name.png 684w, https:\/\/www.stellarinfo.com\/blog\/wp-content\/uploads\/2023\/04\/use-check-names-option-to-verify-object-name-300x168.png 300w, https:\/\/www.stellarinfo.com\/blog\/wp-content\/uploads\/2023\/04\/use-check-names-option-to-verify-object-name-150x84.png 150w\" sizes=\"auto, (max-width: 684px) 100vw, 684px\" \/><\/figure><ul class=\"wp-block-list\">\n<li>If you do not know the name, press the <strong>Advanced<\/strong> button to search for the user&rsquo;s name.<\/li>\n<\/ul><figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"684\" height=\"384\" src=\"https:\/\/www.stellarinfo.com\/blog\/wp-content\/uploads\/2023\/04\/press-advanced-option.png\" alt=\"press Advanced option\" class=\"wp-image-176781 apply-gradient-on-post-images\" srcset=\"https:\/\/www.stellarinfo.com\/blog\/wp-content\/uploads\/2023\/04\/press-advanced-option.png 684w, https:\/\/www.stellarinfo.com\/blog\/wp-content\/uploads\/2023\/04\/press-advanced-option-300x168.png 300w, https:\/\/www.stellarinfo.com\/blog\/wp-content\/uploads\/2023\/04\/press-advanced-option-150x84.png 150w\" sizes=\"auto, (max-width: 684px) 100vw, 684px\" \/><\/figure><ul class=\"wp-block-list\">\n<li>Write your query with the start name or description. In&nbsp;Object Types,&nbsp;you can filter to look at users only. In Locations, you can select a computer or an Active Directory domain.<\/li>\n<\/ul><figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"770\" height=\"891\" src=\"https:\/\/www.stellarinfo.com\/blog\/wp-content\/uploads\/2023\/04\/write-query-and-select-computer.png\" alt=\"write query and select computer\" class=\"wp-image-176782 apply-gradient-on-post-images\" srcset=\"https:\/\/www.stellarinfo.com\/blog\/wp-content\/uploads\/2023\/04\/write-query-and-select-computer.png 770w, https:\/\/www.stellarinfo.com\/blog\/wp-content\/uploads\/2023\/04\/write-query-and-select-computer-259x300.png 259w, https:\/\/www.stellarinfo.com\/blog\/wp-content\/uploads\/2023\/04\/write-query-and-select-computer-768x889.png 768w, https:\/\/www.stellarinfo.com\/blog\/wp-content\/uploads\/2023\/04\/write-query-and-select-computer-150x174.png 150w\" sizes=\"auto, (max-width: 770px) 100vw, 770px\" \/><\/figure><ul class=\"wp-block-list\">\n<li>Once added, make sure to provide&nbsp;<strong>Modify<\/strong>&nbsp;permission. Click <strong>OK.<\/strong><\/li>\n<\/ul><figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"543\" height=\"687\" src=\"https:\/\/www.stellarinfo.com\/blog\/wp-content\/uploads\/2023\/04\/modify-permissions.png\" alt=\"modify permissions\" class=\"wp-image-176784 apply-gradient-on-post-images\" srcset=\"https:\/\/www.stellarinfo.com\/blog\/wp-content\/uploads\/2023\/04\/modify-permissions.png 543w, https:\/\/www.stellarinfo.com\/blog\/wp-content\/uploads\/2023\/04\/modify-permissions-237x300.png 237w, https:\/\/www.stellarinfo.com\/blog\/wp-content\/uploads\/2023\/04\/modify-permissions-150x190.png 150w\" sizes=\"auto, (max-width: 543px) 100vw, 543px\" \/><\/figure><p><strong>Note:<\/strong> If you do not have permission to grant permissions for the folder, you can ask the system administrator to grant the required permissions.<\/p><h3 class=\"wp-block-heading\" id=\"h-2-run-as-administrator\">Solution 3: Run SSMS as Administrator<\/h3><p>The &ldquo;Access is denied&rdquo; error can also occur if you are not running the SQL Server Management Studio (SSMS) as an administrator. To run SSMS with admin rights,<\/p><ul class=\"wp-block-list\">\n<li>Open the Windows menu, look for the SSMS, and right-click on it.<\/li>\n\n\n\n<li>Select the option&nbsp;Run as administrator.<\/li>\n<\/ul><figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"488\" height=\"248\" src=\"https:\/\/www.stellarinfo.com\/blog\/wp-content\/uploads\/2023\/04\/8-3.png\" alt=\"Run as Administrator\" class=\"wp-image-132608 apply-gradient-on-post-images\" srcset=\"https:\/\/www.stellarinfo.com\/blog\/wp-content\/uploads\/2023\/04\/8-3.png 488w, https:\/\/www.stellarinfo.com\/blog\/wp-content\/uploads\/2023\/04\/8-3-300x152.png 300w, https:\/\/www.stellarinfo.com\/blog\/wp-content\/uploads\/2023\/04\/8-3-150x76.png 150w\" sizes=\"auto, (max-width: 488px) 100vw, 488px\" \/><\/figure><h3 class=\"wp-block-heading\" id=\"h-what-to-do-if-your-database-file-is-damaged-or-corrupted\">Solution 4: Check SQL Server Database Engine Service Account Permissions<\/h3><p>The Service Account, under which your SQL Server Service runs, must have the permissions to read and write files in the directories where the database files are stored. If it lacks such permissions, the server will fail to read, write, attach, and detach the database files, leading to the &ldquo;Access is denied&rdquo; error. You can check and ensure that your SQL Server Service Account has the required permissions. If you don&rsquo;t know the service account under which your SQL Server runs, run the below command:<\/p><p><code>SELECT servicename, service_account<\/code><\/p><p><code>FROM sys.dm_server_services;<\/code><\/p><figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"965\" height=\"457\" src=\"https:\/\/www.stellarinfo.com\/blog\/wp-content\/uploads\/2023\/04\/output-of-check-server-database-engine-service-account-permissions-command.png\" alt=\"output of check server database engine service account permissions command\" class=\"wp-image-176795 apply-gradient-on-post-images\" srcset=\"https:\/\/www.stellarinfo.com\/blog\/wp-content\/uploads\/2023\/04\/output-of-check-server-database-engine-service-account-permissions-command.png 965w, https:\/\/www.stellarinfo.com\/blog\/wp-content\/uploads\/2023\/04\/output-of-check-server-database-engine-service-account-permissions-command-300x142.png 300w, https:\/\/www.stellarinfo.com\/blog\/wp-content\/uploads\/2023\/04\/output-of-check-server-database-engine-service-account-permissions-command-768x364.png 768w, https:\/\/www.stellarinfo.com\/blog\/wp-content\/uploads\/2023\/04\/output-of-check-server-database-engine-service-account-permissions-command-150x71.png 150w\" sizes=\"auto, (max-width: 965px) 100vw, 965px\" \/><\/figure><p>Once you know the Service Account and Service Name, then check and grant the required permissions. You can simply add the Administrators group to the security permissions for the data directories where the data and log files are saved by using the SSMS.&nbsp;<\/p><h3 class=\"wp-block-heading\">Solution 5: Repair your Database File<\/h3><p>SQL Server may fail to access the database file, if it is corrupted or damaged. In such a case, you can try <a href=\"https:\/\/www.stellarinfo.com\/article\/restore-sql-server-database-from-bak-file.php\" target=\"_blank\" rel=\"noreferrer noopener\">restoring the database from backup<\/a>. If you do not have a current backup, then you can repair the database by using the DBCC CHECKDB command. Here is the syntax:<\/p><p><code>DBCC CHECKDB<\/code><\/p><p>&nbsp;&nbsp;&nbsp;<code> [ ( database_name | database_id | 0<\/code><\/p><p>&nbsp;&nbsp;<code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [ , NOINDEX<\/code><\/p><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<code>&nbsp; | , { REPAIR_ALLOW_DATA_LOSS | REPAIR_FAST | REPAIR_REBUILD } ]<\/code><\/p><p><code>&nbsp;&nbsp;&nbsp; ) ]<\/code><\/p><p>&nbsp;<code>&nbsp;&nbsp; [ WITH<\/code><\/p><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <code>{<\/code><\/p><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<code>&nbsp;&nbsp; [ ALL_ERRORMSGS ]<\/code><\/p><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<code> [ , EXTENDED_LOGICAL_CHECKS ]<\/code><\/p><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <code>[ , NO_INFOMSGS ]<\/code><\/p><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<code> [ , TABLOCK ]<\/code><\/p><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <code>[ , ESTIMATEONLY ]<\/code><\/p><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<code> [ , { PHYSICAL_ONLY | DATA_PURITY } ]<\/code><\/p><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<code> [ , MAXDOP = number_of_processors ]<\/code><\/p><p>&nbsp;&nbsp;<code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<\/code><\/p><p><code>&nbsp;&nbsp;&nbsp; ]<\/code><\/p><p><code>]<\/code><\/p><p><em><strong>Note:<\/strong> The <a href=\"https:\/\/www.stellarinfo.com\/blog\/how-to-repair-sql-database-using-dbcc-checkdb-command\/\">DBCC CHECKDB command<\/a> with REPAIR_ALLOW_DATA_LOSS option can help you repair the database but can cause data loss.<\/em><\/p><h3 class=\"wp-block-heading\">Solution 6: Repair your Backup File<\/h3><p>If your backup file is corrupted, then you may fail to restore it and get the &ldquo;Operating system error 5 &ndash; Access is denied&rdquo; error. In such a situation, you can use Stellar Repair for MS SQL Technician &ndash; a professional <a href=\"https:\/\/www.stellarinfo.com\/sql-database-repair.php\" target=\"_blank\" rel=\"noreferrer noopener\">SQL repair software<\/a> that can recover all the data from corrupt SQL database backup (.bak) file. The software supports all SQL backup types, including Full Backup, Differential Backup, and Transaction Log Backup. It can also repair corrupted database (MDF\/NDF) files and recover all the objects, including deleted records, with complete precision. The tool is compatible with MS SQL Server 2022, 2019, and lower versions.<\/p><h2 class=\"wp-block-heading\" id=\"conclusion\"><a><\/a>Conclusion<\/h2><p>The error &ldquo;Operating system error 5: &ldquo;(Access is denied)&rdquo; in SQL Server can occur due to various reasons. You can follow the methods mentioned in this post to resolve the error. If the backup file or the database file you are trying to access is corrupted or damaged, then you can use <a href=\"https:\/\/www.stellarinfo.com\/restore-sql-database.php\" target=\"_blank\" rel=\"noreferrer noopener\">Stellar Repair for MS SQL Technician<\/a>. This software is designed to repair corrupt or damaged SQL database and backup files, and recover all the objects with complete integrity.<\/p><p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>You may encounter the error &ldquo;Operating system error 5: Access is denied&rdquo;&hellip; <a class=\"more-link\" href=\"https:\/\/www.stellarinfo.com\/blog\/fix-operating-system-error-5-access-is-denied-in-ms-sql-server\">Continue reading <span class=\"screen-reader-text\">How to Fix Operating System Error 5: (Access is Denied) in MS SQL Server?<\/span><\/a><\/p>\n","protected":false},"author":82,"featured_media":132640,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[10],"tags":[5009,5004,5006,5007,5008,5005],"class_list":["post-132598","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-database-recovery","tag-repairtool","tag-sqlserver","tag-sqlservererror","tag-ssms","tag-stellarrepairformssql","tag-unabletoopenphysicalfile","entry"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.9 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Operating System Error 5 (Access is Denied) in MS SQL Server<\/title>\n<meta name=\"description\" content=\"Learn causes of Msg 5120 Unable to open the physical file Operating system error 5: Access is denied\u201d in SQL Server and its solutions.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.stellarinfo.com\/blog\/fix-operating-system-error-5-access-is-denied-in-ms-sql-server\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Operating System Error 5 (Access is Denied) in MS SQL Server\" \/>\n<meta property=\"og:description\" content=\"Learn causes of Msg 5120 Unable to open the physical file Operating system error 5: Access is denied\u201d in SQL Server and its solutions.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.stellarinfo.com\/blog\/fix-operating-system-error-5-access-is-denied-in-ms-sql-server\/\" \/>\n<meta property=\"og:site_name\" content=\"Stellar Data Recovery Blog\" \/>\n<meta property=\"article:published_time\" content=\"2023-04-26T06:08:29+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-02-04T05:51:31+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.stellarinfo.com\/blog\/wp-content\/uploads\/2023\/04\/How-to-Fix-Unable-to-Open-the-Physical-File-Error-in-SQL-Server.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1000\" \/>\n\t<meta property=\"og:image:height\" content=\"600\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Monika Dadool\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Monika Dadool\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.stellarinfo.com\/blog\/fix-operating-system-error-5-access-is-denied-in-ms-sql-server\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.stellarinfo.com\/blog\/fix-operating-system-error-5-access-is-denied-in-ms-sql-server\/\"},\"author\":{\"name\":\"Monika Dadool\",\"@id\":\"https:\/\/www.stellarinfo.com\/blog\/#\/schema\/person\/02a465e9b5b4912eafedd1ae248558fd\"},\"headline\":\"How to Fix Operating System Error 5: (Access is Denied) in MS SQL Server?\",\"datePublished\":\"2023-04-26T06:08:29+00:00\",\"dateModified\":\"2025-02-04T05:51:31+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.stellarinfo.com\/blog\/fix-operating-system-error-5-access-is-denied-in-ms-sql-server\/\"},\"wordCount\":1170,\"image\":{\"@id\":\"https:\/\/www.stellarinfo.com\/blog\/fix-operating-system-error-5-access-is-denied-in-ms-sql-server\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.stellarinfo.com\/blog\/wp-content\/uploads\/2023\/04\/How-to-Fix-Unable-to-Open-the-Physical-File-Error-in-SQL-Server.jpg\",\"keywords\":[\"repairtool\",\"sqlserver\",\"sqlservererror\",\"SSMS\",\"stellarrepairformssql\",\"unabletoopenphysicalfile\"],\"articleSection\":[\"SQL Database Repair\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.stellarinfo.com\/blog\/fix-operating-system-error-5-access-is-denied-in-ms-sql-server\/\",\"url\":\"https:\/\/www.stellarinfo.com\/blog\/fix-operating-system-error-5-access-is-denied-in-ms-sql-server\/\",\"name\":\"Operating System Error 5 (Access is Denied) in MS SQL Server\",\"isPartOf\":{\"@id\":\"https:\/\/www.stellarinfo.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.stellarinfo.com\/blog\/fix-operating-system-error-5-access-is-denied-in-ms-sql-server\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.stellarinfo.com\/blog\/fix-operating-system-error-5-access-is-denied-in-ms-sql-server\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.stellarinfo.com\/blog\/wp-content\/uploads\/2023\/04\/How-to-Fix-Unable-to-Open-the-Physical-File-Error-in-SQL-Server.jpg\",\"datePublished\":\"2023-04-26T06:08:29+00:00\",\"dateModified\":\"2025-02-04T05:51:31+00:00\",\"author\":{\"@id\":\"https:\/\/www.stellarinfo.com\/blog\/#\/schema\/person\/02a465e9b5b4912eafedd1ae248558fd\"},\"description\":\"Learn causes of Msg 5120 Unable to open the physical file Operating system error 5: Access is denied\u201d in SQL Server and its solutions.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.stellarinfo.com\/blog\/fix-operating-system-error-5-access-is-denied-in-ms-sql-server\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.stellarinfo.com\/blog\/fix-operating-system-error-5-access-is-denied-in-ms-sql-server\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.stellarinfo.com\/blog\/fix-operating-system-error-5-access-is-denied-in-ms-sql-server\/#primaryimage\",\"url\":\"https:\/\/www.stellarinfo.com\/blog\/wp-content\/uploads\/2023\/04\/How-to-Fix-Unable-to-Open-the-Physical-File-Error-in-SQL-Server.jpg\",\"contentUrl\":\"https:\/\/www.stellarinfo.com\/blog\/wp-content\/uploads\/2023\/04\/How-to-Fix-Unable-to-Open-the-Physical-File-Error-in-SQL-Server.jpg\",\"width\":1000,\"height\":600},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.stellarinfo.com\/blog\/fix-operating-system-error-5-access-is-denied-in-ms-sql-server\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.stellarinfo.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Fix Operating System Error 5: (Access is Denied) in MS SQL Server?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.stellarinfo.com\/blog\/#website\",\"url\":\"https:\/\/www.stellarinfo.com\/blog\/\",\"name\":\"Stellar Data Recovery Blog\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.stellarinfo.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.stellarinfo.com\/blog\/#\/schema\/person\/02a465e9b5b4912eafedd1ae248558fd\",\"name\":\"Monika Dadool\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.stellarinfo.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/7d22d2cc256776033dcf284e9c6b96fcf19473429aa25ea91b3f7561ae5e8b7a?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/7d22d2cc256776033dcf284e9c6b96fcf19473429aa25ea91b3f7561ae5e8b7a?s=96&d=mm&r=g\",\"caption\":\"Monika Dadool\"},\"description\":\"Monika Dadool is a Senior Content Writer at Stellar with over 5 years of experience in technical writing. She is a tech enthusiast and expert who specializes in writing about SQL Server, MySQL Server, MariaDB Server, Microsoft Access, Active Directory, email recovery, Microsoft 365, pattern recognition, machine learning, data recovery, file repair, and operating systems like Linux, Windows, and Mac. She also writes about accounting software such as QuickBooks and Sage 50, as well as web-scripting languages like HTML, JavaScript, Python, PHP, Visual Basic, ASP.NET, and AJAX. Monika is passionate about researching and exploring new technologies, and she enjoys developing engaging technical blogs that help organizations and database administrators resolve various issues. When she's not creating content, you can find her on social media, watching web series, reading books, or exploring new food recipes.\",\"sameAs\":[\"https:\/\/www.linkedin.com\/in\/monika-dadool-105a87163\/\"],\"url\":\"https:\/\/www.stellarinfo.com\/blog\/author\/monika\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Operating System Error 5 (Access is Denied) in MS SQL Server","description":"Learn causes of Msg 5120 Unable to open the physical file Operating system error 5: Access is denied\u201d in SQL Server and its solutions.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.stellarinfo.com\/blog\/fix-operating-system-error-5-access-is-denied-in-ms-sql-server\/","og_locale":"en_US","og_type":"article","og_title":"Operating System Error 5 (Access is Denied) in MS SQL Server","og_description":"Learn causes of Msg 5120 Unable to open the physical file Operating system error 5: Access is denied\u201d in SQL Server and its solutions.","og_url":"https:\/\/www.stellarinfo.com\/blog\/fix-operating-system-error-5-access-is-denied-in-ms-sql-server\/","og_site_name":"Stellar Data Recovery Blog","article_published_time":"2023-04-26T06:08:29+00:00","article_modified_time":"2025-02-04T05:51:31+00:00","og_image":[{"width":1000,"height":600,"url":"https:\/\/www.stellarinfo.com\/blog\/wp-content\/uploads\/2023\/04\/How-to-Fix-Unable-to-Open-the-Physical-File-Error-in-SQL-Server.jpg","type":"image\/jpeg"}],"author":"Monika Dadool","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Monika Dadool","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.stellarinfo.com\/blog\/fix-operating-system-error-5-access-is-denied-in-ms-sql-server\/#article","isPartOf":{"@id":"https:\/\/www.stellarinfo.com\/blog\/fix-operating-system-error-5-access-is-denied-in-ms-sql-server\/"},"author":{"name":"Monika Dadool","@id":"https:\/\/www.stellarinfo.com\/blog\/#\/schema\/person\/02a465e9b5b4912eafedd1ae248558fd"},"headline":"How to Fix Operating System Error 5: (Access is Denied) in MS SQL Server?","datePublished":"2023-04-26T06:08:29+00:00","dateModified":"2025-02-04T05:51:31+00:00","mainEntityOfPage":{"@id":"https:\/\/www.stellarinfo.com\/blog\/fix-operating-system-error-5-access-is-denied-in-ms-sql-server\/"},"wordCount":1170,"image":{"@id":"https:\/\/www.stellarinfo.com\/blog\/fix-operating-system-error-5-access-is-denied-in-ms-sql-server\/#primaryimage"},"thumbnailUrl":"https:\/\/www.stellarinfo.com\/blog\/wp-content\/uploads\/2023\/04\/How-to-Fix-Unable-to-Open-the-Physical-File-Error-in-SQL-Server.jpg","keywords":["repairtool","sqlserver","sqlservererror","SSMS","stellarrepairformssql","unabletoopenphysicalfile"],"articleSection":["SQL Database Repair"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.stellarinfo.com\/blog\/fix-operating-system-error-5-access-is-denied-in-ms-sql-server\/","url":"https:\/\/www.stellarinfo.com\/blog\/fix-operating-system-error-5-access-is-denied-in-ms-sql-server\/","name":"Operating System Error 5 (Access is Denied) in MS SQL Server","isPartOf":{"@id":"https:\/\/www.stellarinfo.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.stellarinfo.com\/blog\/fix-operating-system-error-5-access-is-denied-in-ms-sql-server\/#primaryimage"},"image":{"@id":"https:\/\/www.stellarinfo.com\/blog\/fix-operating-system-error-5-access-is-denied-in-ms-sql-server\/#primaryimage"},"thumbnailUrl":"https:\/\/www.stellarinfo.com\/blog\/wp-content\/uploads\/2023\/04\/How-to-Fix-Unable-to-Open-the-Physical-File-Error-in-SQL-Server.jpg","datePublished":"2023-04-26T06:08:29+00:00","dateModified":"2025-02-04T05:51:31+00:00","author":{"@id":"https:\/\/www.stellarinfo.com\/blog\/#\/schema\/person\/02a465e9b5b4912eafedd1ae248558fd"},"description":"Learn causes of Msg 5120 Unable to open the physical file Operating system error 5: Access is denied\u201d in SQL Server and its solutions.","breadcrumb":{"@id":"https:\/\/www.stellarinfo.com\/blog\/fix-operating-system-error-5-access-is-denied-in-ms-sql-server\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.stellarinfo.com\/blog\/fix-operating-system-error-5-access-is-denied-in-ms-sql-server\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.stellarinfo.com\/blog\/fix-operating-system-error-5-access-is-denied-in-ms-sql-server\/#primaryimage","url":"https:\/\/www.stellarinfo.com\/blog\/wp-content\/uploads\/2023\/04\/How-to-Fix-Unable-to-Open-the-Physical-File-Error-in-SQL-Server.jpg","contentUrl":"https:\/\/www.stellarinfo.com\/blog\/wp-content\/uploads\/2023\/04\/How-to-Fix-Unable-to-Open-the-Physical-File-Error-in-SQL-Server.jpg","width":1000,"height":600},{"@type":"BreadcrumbList","@id":"https:\/\/www.stellarinfo.com\/blog\/fix-operating-system-error-5-access-is-denied-in-ms-sql-server\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.stellarinfo.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How to Fix Operating System Error 5: (Access is Denied) in MS SQL Server?"}]},{"@type":"WebSite","@id":"https:\/\/www.stellarinfo.com\/blog\/#website","url":"https:\/\/www.stellarinfo.com\/blog\/","name":"Stellar Data Recovery Blog","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.stellarinfo.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.stellarinfo.com\/blog\/#\/schema\/person\/02a465e9b5b4912eafedd1ae248558fd","name":"Monika Dadool","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.stellarinfo.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/7d22d2cc256776033dcf284e9c6b96fcf19473429aa25ea91b3f7561ae5e8b7a?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/7d22d2cc256776033dcf284e9c6b96fcf19473429aa25ea91b3f7561ae5e8b7a?s=96&d=mm&r=g","caption":"Monika Dadool"},"description":"Monika Dadool is a Senior Content Writer at Stellar with over 5 years of experience in technical writing. She is a tech enthusiast and expert who specializes in writing about SQL Server, MySQL Server, MariaDB Server, Microsoft Access, Active Directory, email recovery, Microsoft 365, pattern recognition, machine learning, data recovery, file repair, and operating systems like Linux, Windows, and Mac. She also writes about accounting software such as QuickBooks and Sage 50, as well as web-scripting languages like HTML, JavaScript, Python, PHP, Visual Basic, ASP.NET, and AJAX. Monika is passionate about researching and exploring new technologies, and she enjoys developing engaging technical blogs that help organizations and database administrators resolve various issues. When she's not creating content, you can find her on social media, watching web series, reading books, or exploring new food recipes.","sameAs":["https:\/\/www.linkedin.com\/in\/monika-dadool-105a87163\/"],"url":"https:\/\/www.stellarinfo.com\/blog\/author\/monika\/"}]}},"_links":{"self":[{"href":"https:\/\/www.stellarinfo.com\/blog\/wp-json\/wp\/v2\/posts\/132598","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.stellarinfo.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.stellarinfo.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.stellarinfo.com\/blog\/wp-json\/wp\/v2\/users\/82"}],"replies":[{"embeddable":true,"href":"https:\/\/www.stellarinfo.com\/blog\/wp-json\/wp\/v2\/comments?post=132598"}],"version-history":[{"count":16,"href":"https:\/\/www.stellarinfo.com\/blog\/wp-json\/wp\/v2\/posts\/132598\/revisions"}],"predecessor-version":[{"id":176836,"href":"https:\/\/www.stellarinfo.com\/blog\/wp-json\/wp\/v2\/posts\/132598\/revisions\/176836"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.stellarinfo.com\/blog\/wp-json\/wp\/v2\/media\/132640"}],"wp:attachment":[{"href":"https:\/\/www.stellarinfo.com\/blog\/wp-json\/wp\/v2\/media?parent=132598"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.stellarinfo.com\/blog\/wp-json\/wp\/v2\/categories?post=132598"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.stellarinfo.com\/blog\/wp-json\/wp\/v2\/tags?post=132598"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}