Bug #38379 MySQLInstanceConfig command-line only creates new services with the default name
Submitted: 25 Jul 2008 18:09 Modified: 17 Aug 2009 18:34
Reporter: Iggy Galarza
Status: Closed
Category:Server: Config Wizard Severity:S2 (Serious)
Version:4.x, 5.x, 6.x OS:Microsoft Windows
Assigned to: Iggy Galarza Target Version:5.0+
Triage: Triaged: D3 (Medium)

[25 Jul 2008 18:09] Iggy Galarza
Description:
This bug is also described here: http://www.netbeans.org/issues/show_bug.cgi?id=141392

The /i and ServiceName parameter combination is not handled properly when running
MySQLInstanceConfig.exe in silent mode. For example, this command:

MySQLInstanceConfig.exe -i -q "-nMySQL Server 5.0" "-pC:\Program Files\MySQL\MySQL Server
5.0" -v5.0.51b -lC:\mysql_config.log ServiceName=MySQL50 AddBinToPath=no
ServerType=DEVELOPMENT DatabaseType=MIXED ConnectionUsage=DSS Charset=utf8
SkipNetworking=no Port=3306 RootPassword=

Fails with this log message:

"The service  could not be started. Error: 0"

If the ServiceName=MySQL50 parameter is omitted, the default service "MySQL" is created
and started successfully.

How to repeat:
1. Install mysql-essential-5.0.51b-win32.msi using all defaults but do not configure the
instance with the Config Wizard.
2. Execute the following command:
"C:\Program Files\MySQL\MySQL Server 5.0\bin\MySQLInstanceConfig.exe" -i -q "-nMySQL
Server 5.0" "-pC:\Program Files\MySQL\MySQL Server 5.0" -v5.0.51b -lC:\mysql_config.log
"-tC:\Program Files\MySQL\MySQL Server 5.0\my-template.ini" "-cC:\Program
Files\MySQL\MySQL Server 5.0\my.ini" ServiceName=MySQL50 AddBinToPath=no
ServerType=DEVELOPMENT DatabaseType=MIXED ConnectionUsage=DSS Charset=utf8
SkipNetworking=no Port=3306 RootPassword=
3. Check the file C:\mysql_config.log for the error "The service  could not be started.
Error: 0"
4. Execute the same command without the ServiceName=MySQL50 parameter and check the log
file for success.

Suggested fix:
MySQLInstanceConfig is attempting to start an existing service with the specified name. 
This is incorrect for install.  Change MySQLInstanceConfig to create a service with
custom name instead.
[26 Jul 2008 2:11] Patrick Crews
Ok to push.

Verified changes fix the defect described.
[17 Aug 2009 18:34] MC Brown
A note has been added to the 4.x, 5.x and 6.x changelogs: 

When running the MySQL Instance Configuration Wizard in command-line only mode, the
service name would be ignored (effectively creating all instances with the default MySQL
service name), irrespective of the name specified on the command line. However, the
wizard would attempt to start the service with the specified name, and would fail.