# Installing MySQL as a local service

I am able to install the service normally, using the --install tag. But I need to be able to run mysql as a local service, due to access privileges.

The my.ini file is set up correctly, proven by being able to install not using a local service.

Exact Error:

C:\Program Files (x86)\Stolen Vehicle System\mysql\bin\mysqld" --install MySQLStolenVehicle --debug --local-service

Gives

mysqld.exe has stopped working

What's wrong?

-

## migrated from stackoverflow.comOct 26 '11 at 14:07

This question came from our site for professional and enthusiast programmers.

you probably can't use --install with --debug or --local-service switches...

try mysqld --install MySQLStolenVehicle --defaults-file=C:\path\to\your\my.cnf and when check the Services MMC at "Administrative Tools" if it's using the LocalService acct, and if it's starting automatically...

if you need debug, set this on your my.cnf file

-

Have you tried running this command with the --local-service option directly after the service name? e.g. --install MySQLStolenVehicle --local-service. Currently you have a --debug option in between and this could be causing the problem.

-
with (x86) in Prog Files dir? :) –  Marcelo Bittencourt Oct 26 '11 at 22:58

The "--local-service" parameter does not exist, at least not in my 5.5 version of mySQL. To find out what parameters actually exist and how mysqld actually works, issue the following command from the .\mysql\bin directory: "mysqld --verbose --help > help.txt"

The resulting help.txt file should provide you the answers you need. I used --defaults-file= and got my XAMPP version of mySQL installed as a service and have been able to use MySQL Workbench to access my databases.

-