Bug #47907 Incorrect service startup parameters in Windows
Submitted: 8 Oct 2009 5:15 Modified: 8 Oct 2009 8:50
Reporter: Bogdan Degtyariov Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server: Installing Severity:S3 (Non-critical)
Version:5.1.39 OS:Windows
Assigned to: CPU Architecture:Any
Tags: defaults-file, install

[8 Oct 2009 5:15] Bogdan Degtyariov
Description:
Service startup parameters are written incorrectly into the windows registry when install mysqld.exe as a service from command line. To be more specific: installer omits --defaults-file option and leaves only the parameter value.

How to repeat:
I want to install mysqld.exe as windows service with the name my5139 and specify the location of my.ini (C:\mysql-5.1.39-winx64\my.ini):

-----------------------------------------------
C:\mysql-5.1.39-winx64\bin> mysqld.exe --install my5139 --defaults-file=C:\mysql-5.1.39-winx64\my.ini
Service successfully installed.
-----------------------------------------------

Try to start the service:

-----------------------------------------------
C:\mysql-5.1.39-winx64\bin> net start my5139a
The my5139a service is starting.
The my5139a service could not be started.

A system error has occurred.

System error 1067 has occurred.

The process terminated unexpectedly.
-----------------------------------------------

The error log file contains the following:

C:\mysql-5.1.39-winx64\bin\mysqld.exe: Too many arguments (first extra is 'C:\mysql-5.1.39-winx64\my.ini').
Use --verbose --help to get a list of available options
091008 16:05:58 [ERROR] Aborting

-----------------------------------------------

Finally, in the service properties I see the following startup command:

C:\mysql-5.1.39-winx64\bin\mysqld.exe C:\mysql-5.1.39-winx64\my.ini my5139

Obviously, the service cannot start because --defaults-file option is not specified. After editing the registry manually I was able to run the server:

C:\mysql-5.1.39-winx64\bin\mysqld.exe --defaults-file=C:\mysql-5.1.39-winx64\my.ini my5139a

NOTE: MySQL 5.1.37 does not have this problem, but both x32 and x64 versions of MySQL 5.1.39 are affected

Suggested fix:
Put --defaults-file=<path_to_my_ini> into the service startup command as it was with previous versions of MySQL server.
[8 Oct 2009 8:04] MySQL Verification Team
Bogdan is this a duplicate of bug #46917 ?
[8 Oct 2009 8:09] Peter Laursen
Yes it is a duplicate (I reported the other one with snaps .39 and .40 builds).

There is one more detail and that is that the 64 bit server does not add the "WOW64" registry key.  I do not know how important that is, but if it means that windows will restrict memory allocation to the server it is rather important/serious!
[8 Oct 2009 8:50] Bogdan Degtyariov
Marked as duplicate of #46917 (mysqd-nt installs wrong)