[MDEV-4713] Access denied message accessing symlinked existing database in data dir Created: 2013-06-26  Updated: 2013-06-27  Resolved: 2013-06-26

Status: Closed
Project: MariaDB Server
Component/s: None
Affects Version/s: 5.5.31
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Scott Harman Assignee: Unassigned
Resolution: Not a Bug Votes: 0
Labels: symlink
Environment:

Win 7 x64, MariaDB 5.5.31 x64, MySQL 5.5.31 x64


Attachments: PNG File Administrator_ C__Windows_system32_cmd.exe - _c__Program Files_MariaDB 5.5_bin___2013-06-26_08-46-21.png     Zip Archive Call Stack.zip     Zip Archive Logfile.zip    

 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.



 Comments   
Comment by Vladislav Vaintroub [ 2013-06-26 ]

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.

Comment by Vladislav Vaintroub [ 2013-06-26 ]

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

Comment by Vladislav Vaintroub [ 2013-06-26 ]

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.

Comment by Scott Harman [ 2013-06-27 ]

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

Generated at Thu Feb 08 06:58:34 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.