Numerous times now, I’ve seen people have troubles creating MySQL services on Windows manually (using ‘sc’), whether it be for mysqld itself, MySQL Proxy, or the MySQL Enterprise Monitor and/or Agent.
The proper syntax for ‘sc’ can get tricky when you have spaces in pathnames, which is very common in Windows, and the need for –defaults-file (which means two paths each potentially containing spaces).
So, if you have spaces in both your binpath and your path to –defaults-file, then the following syntax will work for you (all on a single line):
sc create MySQLEnterpriseMonitorAgent binpath= ""C:Program FilesMySQLEnterpriseAgentbinmysql-monitor-agent.exe" --defaults-file="C:Program FilesMySQLEnterpriseAgentetcmysql-monitor-agent.ini"" DisplayName= "MySQL Enterprise Monitor Agent" start= "auto"
Note that you could easily use the exact same syntax to install a Windows service for the MySQL server itself …[Read more]