If you’re installing MySQL on a Windows machine and run into the error:

Install/Remove of the Service Denied!

This error indicates that the `mysqld` command lacks the necessary administrative permissions to install a Windows service.

Why the Install/Remove of the Service Denied Error Occurs

The Install/Remove of the Service Denied message means your current command prompt session doesn’t have the admin rights needed to install the MySQL Windows service. MySQL needs elevated privileges to register itself as a service in Windows.

To resolve this issue, open the Command Prompt as an administrator and then proceed with the MySQL service installation.

Rerun your install command. Example has a generic placeholder for the my.ini location.

C:\Program Files\MySQL\MySQL Server 8.0\bin>mysqld --install MySQL80 --defaults-file="C:\Path\to\my.ini"
Service successfully installed.

Start the service.

net start MySQL8_02

If you get an error like the one below, get more details by running the command: mysqld --defaults-file="Path\to\my.ini"--console.

C:\Program Files\MySQL\MySQL Server 8.0\bin>net start MySQL8_02
The MySQL8_02 service is starting.
The MySQL8_02 service could not be started.

The service did not report an error.

More help is available by typing NET HELPMSG 3534.

The Install/Remove of the Service Denied error is a common roadblock when setting up MySQL manually on Windows. Running your command prompt with administrative privileges usually resolves it quickly.

Need more MySQL tips? Reach out or explore our other blogs.

Please contact us for any questions.