Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-4713

Access denied message accessing symlinked existing database in data dir

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Not a Bug
    • Affects Version/s: 5.5.31
    • Fix Version/s: None
    • Component/s: None
    • Labels:
    • Environment:
      Win 7 x64, MariaDB 5.5.31 x64, MySQL 5.5.31 x64

      Description

      Hi guys
      I'm trying to load a database that I've got stored on another drive, using the same method as I currently use with MySQL
      I drop a symbolic link to the database folder of the database into my data drive, and simply access it
      Under MySQL this works perfectly happily, however under MariaDB, I get an access deneied message in procmon reported trying to access the db.opts file and accessing the folder itself
      It doesn't matter whether I use a junction or a symlink, both error in exactly the same way.

        Gliffy Diagrams

          Attachments

            Activity

            Hide
            wlad Vladislav Vaintroub added a comment - - edited

            User, that runs mysqld.exe should be able to access fiiles under the directory . MariaDB runs under NetworkService, by default, as it is a (relatively) weak predefined account, for security reasons. MySQL traditionally ran as LocalSystem, the most powerful account (comparable to Unix "root" ), but I think they have changed it with "universal" installer, and run, just like we, as NetworkService.

            The above means, that if you use symlink to some other directory, you should make sure NetworkService, or whatever user is running mysqld.exe, has full access to the directory.

            Show
            wlad Vladislav Vaintroub added a comment - - edited User, that runs mysqld.exe should be able to access fiiles under the directory . MariaDB runs under NetworkService, by default, as it is a (relatively) weak predefined account, for security reasons. MySQL traditionally ran as LocalSystem, the most powerful account (comparable to Unix "root" ), but I think they have changed it with "universal" installer, and run, just like we, as NetworkService. The above means, that if you use symlink to some other directory, you should make sure NetworkService, or whatever user is running mysqld.exe, has full access to the directory.
            Hide
            wlad Vladislav Vaintroub added a comment - - edited

            You can grant full access to directory and files in this directory to NetworkService account like this

            icacls "C:\path\to\directory" /grant NetworkService:(OI)(CI)F

            as described here http://stackoverflow.com/questions/2928738/how-to-grant-permission-to-users-for-a-directory-using-command-line-in-windows

            Show
            wlad Vladislav Vaintroub added a comment - - edited You can grant full access to directory and files in this directory to NetworkService account like this icacls "C:\path\to\directory" /grant NetworkService:(OI)(CI)F as described here http://stackoverflow.com/questions/2928738/how-to-grant-permission-to-users-for-a-directory-using-command-line-in-windows
            Hide
            wlad Vladislav Vaintroub added a comment -

            I assume this clarifies the issue. I'm closing this as "Not a Bug". But of course, feel free to reopen, if you still think that MariaDB is doing something wrong.

            Show
            wlad Vladislav Vaintroub added a comment - I assume this clarifies the issue. I'm closing this as "Not a Bug". But of course, feel free to reopen, if you still think that MariaDB is doing something wrong.
            Hide
            scottharman Scott Harman added a comment -

            Yeah - I can accept that as closed
            Might be worth updating the documentation to explain that
            Even when I rehomed the Data drive to the same location, it would explain why I couldn't access the database
            Good to know
            Cheers

            Show
            scottharman Scott Harman added a comment - Yeah - I can accept that as closed Might be worth updating the documentation to explain that Even when I rehomed the Data drive to the same location, it would explain why I couldn't access the database Good to know Cheers

              People

              • Assignee:
                Unassigned
                Reporter:
                scottharman Scott Harman
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: