Bug #1597 Start service
Submitted: 18 Oct 2003 15:32 Modified: 18 Oct 2003 15:40
Reporter: [ name withheld ] Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server Severity:S2 (Serious)
Version:4.0.15 OS:Windows (Windows 2000)
Assigned to: CPU Architecture:Any

[18 Oct 2003 15:32] [ name withheld ]
Description:
When I start the service (mysqld-nt.exe), it turn off after a few seconds.
I tried to start it from Administrator services, but same problem.
How comes??

How to repeat:
 

Suggested fix:
[18 Oct 2003 15:40] MySQL Verification Team
Read the host_name.err file for to find the reason why the
server had aborted, or try to run the server as standalone
from a DOS prompt screen for to see the messages errors:

mysqld-nt --standalone --console
[22 Oct 2003 10:23] Gilles Levreau
I have the same problem, and it turns out to be a bug in version 4.0.15 (and 4.0.16 too). The way the server is registered as a service has been changed in 4.0.15 and does it incorrectly.

When the service is started, it expects the last argument to the program to be the service name, but this is now omitted.

Workaround: 
- open the registry editor (regedit), go to the key HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\<your mysql service name>

- edit the subkey 'ImagePath' and add the service name at the end of the command (with a space before it).

- start the service
[22 Oct 2003 10:28] Gilles Levreau
This bug can be fixed by adding these lines to sql/mysqld.cpp, line 2570 (in default_service_handling(), after extra_opt has been added to the command):

  /* Add service name at end of command */
  *pos++= ' ';
  pos = strxnmov(pos, (uint) (end-pos), "\"", servicename, "\"", NullS);