Bug #648 MySQL Service issue on Windows
Submitted: 12 Jun 2003 22:43 Modified: 16 Jun 2003 5:47
Reporter: [ name withheld ] Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server: Installing Severity:S1 (Critical)
Version:4.0.12 OS:Windows (Windows 2000 Advanced Server)
Assigned to: CPU Architecture:Any

[12 Jun 2003 22:43] [ name withheld ]
Description:
Hi,

   I have installed the mysql on win2k machine under C:\mysql directory.
I wanted to create an optional service by running 
mysqld-max-nt --install "my service". I have created a seperate section in C:\Winnt\My.ini for this new service mentioning the datadir and basedir. (as per the instructions for the Bug #641 [Opn->!Bg]) The contents of my.ini are displayed at the end. The service is not starting and giving an error 1053. 

    I have tried even modifying the registry key "WaitToKillServiceTimeout"     at ‘HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control’ in the Registry tree to 120000 (120 seconds). (Read details from MySQLReference manual section 2.6.2.2). Even after this the service is not starting.

   But when I install the default service "MySQL" by running 
"mysqld-max-nt --install" the service starts and creates the InnoDB files properly at correct locations.

The my.ini contents are displayed below:
#This File was made using the WinMySQLAdmin 1.4 Tool
#4/16/2003 11:23:33 AM

#Uncomment or Add only the keys that you know how works.
#Read the MySQL Manual for instructions

[mysqld]
basedir=c:\mysql
datadir=C:\mysql\data
innodb_data_home_dir =
innodb_data_file_path = ibdata1:100M:autoextend

[Some Service]
basedir=c:\mysql
datadir=C:\mysql\data
innodb_data_home_dir =
innodb_data_file_path = ibdata1:100M:autoextend

[WinMySQLadmin]
Server=C:\mysql\bin\mysqld.exe
innodb_data_file_path = ibdata1:10M:autoextend
set-variable = innodb_buffer_pool_size=70M
set-variable = innodb_additional_mem_pool_size=10M
set-variable = innodb_log_file_size=20M
set-variable = innodb_log_buffer_size=8M innodb_flush_log_at_trx_commit=1

How to repeat:
After installing mysql in a default C:\mysql directory. Create my.ini with the above mentioned settings. 
Run mysqld-max-nt --install "my service". Start the service "my service" from Windows services. It does not start.
[13 Jun 2003 3:43] MySQL Verification Team
Some notes about how you have described the bug:

The name of the service (same of the my.ini section) can't
be made up with several words separate with a blank space
e.g:

wrong: my service
right: myservice

The reason is that the server at the star takes the name of
the service using only the first word and for this reason
the service isn't start adequately.
[15 Jun 2003 21:49] [ name withheld ]
Hi,

    Thanks a lot for your kind and quick response.

    I still have the issue even when I use a singleword for the service name. (i.e. "testserv"). Some more info on how I have created the service and my findings.

    I am using CreateService Win32 API to create the service and the service name is "Test Service" (includes spaces in between). After the successful installation of this service, I tried running it and it gave an error. And I installed the default service using "mysqld-max-nt --install". It installed the service by name "MySQL". After installing this the default service, the "Test Service" started working i.e. I could start the "Test Service" successfully.
       
    Any idea on why this behaviour?. Thanks a lot for your kind and quick response again.

Thanigai
[16 Jun 2003 5:47] MySQL Verification Team
If you are using you own code for to install the service
this isn't a MySQL bug.
Please study the source code how MySQL install the optional
service and how it start internally this type the service.
The optional service image path is different than the
default one.