Bug #6425 MySQL Administrator demaging MySQL service entry
Submitted: 4 Nov 2004 8:44 Modified: 3 Feb 2005 15:28
Reporter: Martin Greisler Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Administrator Severity:S3 (Non-critical)
Version:1.0.13 OS:Windows (Windows Server 2003)
Assigned to: Assigned Account CPU Architecture:Any

[4 Nov 2004 8:44] Martin Greisler
Description:
Setting up MySQL to run as Windows service by use of something like

cmd /c ""C:\Programme\MySQL\MySQL Server 4.1\bin\mysqld-nt.exe" --install MySQL --defaults-file="C:\Program Files\MySQL\MySQL Server
 4.1\my.ini""

creates a fine working service entry 'MySQL' in

HKLM\SYSTEM\CurrentControlSet\Services.

This service entry contains a Value 'ImagePath' of the type 'REG_EXPAND_SZ' looking something like, when exported to a file:

"ImagePath"=hex(2):22,00,43,00,3a,00,5c,00,50,00,72,00,6f,00,67,00,72,00,61,00,\
  6d,00,6d,00,65,00,5c,00,4d,00,79,00,53,00,51,00,4c,00,5c,00,4d,00,79,00,53,\
  00,51,00,4c,00,20,00,53,00,65,00,72,00,76,00,65,00,72,00,20,00,34,00,2e,00,\
  31,00,5c,00,62,00,69,00,6e,00,5c,00,6d,00,79,00,73,00,71,00,6c,00,64,00,2d,\
  00,6e,00,74,00,2e,00,65,00,78,00,65,00,22,00,20,00,22,00,2d,00,2d,00,64,00,\
  65,00,66,00,61,00,75,00,6c,00,74,00,73,00,2d,00,66,00,69,00,6c,00,65,00,3d,\
  00,43,00,3a,00,5c,00,50,00,72,00,6f,00,67,00,72,00,61,00,6d,00,20,00,46,00,\
  69,00,6c,00,65,00,73,00,5c,00,4d,00,79,00,53,00,51,00,4c,00,5c,00,4d,00,79,\
  00,53,00,51,00,4c,00,20,00,53,00,65,00,72,00,76,00,65,00,72,00,20,00,34,00,\
  2e,00,31,00,5c,00,6d,00,79,00,2e,00,63,00,6e,00,66,00,22,00,20,00,4d,00,79,\
  00,53,00,51,00,4c,00,00,00

Everything is fine until here.

It seems that the MySQL Administrator tool does not find the configuration file. It shows C:\Programme\MySQL\MySQL Server 4.1\my.cnf (seems to be it's default) as config-filename in red letters.

Correcting this path to match the existing configuration file and applying this to the existing service overwrites the 'ImagePath' value. But the new value is of type 'REG_SZ' which looks like this, if it is exported from the registry:

"ImagePath"="\"C:\\Programme\\MySQL\\MySQL Server 4.1\\bin\\mysqld-nt\" --defaults-file=\"C:\\Programme\\MySQL\\MySQL Server 4.1\\my.ini\" MySQL"

Whith this entry Windows isn't able to start the service any more.

How to repeat:
see description

Suggested fix:
Put the configuration file where MySQL Administrator looks for it (<MySQL Installation directory>\my.cnf) and install the service to lokk for this file:

cmd /c ""C:\Programme\MySQL\MySQL Server 4.1\bin\mysqld-nt.exe" --install MySQL --defaults-file="C:\Program Files\MySQL\MySQL Server
 4.1\my.cnf""

NEVER use the 'Apply Changes' Button in the 'Configure Service' Tab of the MySQL Administrator.
[4 Nov 2004 9:45] Martin Greisler
I've just found and checked version 1.0.14, it's the same.

Martin
[3 Jan 2005 15:28] Michael G. Zinner
Thanks for reporting. The REG_EXPAND_SZ issue has been addressed. Could you check if the Administrator now also finds your config file?

I prepared a special build for you.

ftp://ftp.mysql.com:/pub/mysql/download/mysql-administrator-1.0.19-win.msi

A normal ImagePath should look like this:

"C:\Programme\MySQL\MySQL Server 4.1\bin\mysqld-nt" --defaults-file="C:\Programme\MySQL\MySQL Server 4.1\my.ini" MySQL41

If the config file is still not found, please verify the Key HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MySQL41

If you have more than one MySQL Instance installed on your machine, please hold the Ctrl-Key in the connection dialog and select [Skip] to skip the login and directly manage the instances.

Thanks a lot.
[14 Feb 2005 22:54] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".