[MDEV-17072] mysql_install_db.exe -d='datafolder' --service='servicename' adds the required permissions only to the data folder Created: 2018-08-26  Updated: 2018-09-21  Resolved: 2018-09-21

Status: Closed
Project: MariaDB Server
Component/s: Platform Windows
Affects Version/s: 10.2.14
Fix Version/s: N/A

Type: Bug Priority: Minor
Reporter: suyecufi Assignee: Vladislav Vaintroub
Resolution: Not a Bug Votes: 0
Labels: None


 Description   

mysql_install_db.exe -d='datafolder' --service='servicename' adds the required permissions only to the data folder causing the following error trying to launch the service with the "sc start servicename" command:
[SC] StartService FAILED 5:
Access is denied.

Note that the mysql_install_db command automatically finds the mysqld binary that lies in the same folder and sets the service launch parameters, so it's my expectation that the permissions are set also for the mysqld binary and the share folder.

The solution is to manually add the required permissions also to the mysqld binary.



 Comments   
Comment by Vladislav Vaintroub [ 2018-09-21 ]

The required permissions, for the service to run are that NETWORK SERVICE can read, write, and create the data files, because service that is created with mysql_install_db.exe runs as Network Service user.

Start service("sc start" or "net start") in elevated command prompt, "as Administrator". You already had to run mysql_install_db.exe elevated, so that service could be created. That service creation, start and stop require admin privileges, is rather normal on Windows, and most of the services behave that way.

Generated at Thu Feb 08 08:33:42 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.