Bug #27535 Installing Windows service with --defaults-file option - quotation marks issues
Submitted: 29 Mar 2007 19:43 Modified: 17 Aug 2009 16:40
Reporter: Todd Farmer (OCA) Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Installing Severity:S3 (Non-critical)
Version:5.0 OS:Windows (Windows)
Assigned to: Iggy Galarza CPU Architecture:Any
Tags: bfsm_2007_05_31, bfsm_2007_06_21

[29 Mar 2007 19:43] Todd Farmer
Description:
The Windows installer for MySQL will create a Windows Service with the following executable path:

"C:\Program Files\MySQL\MySQL Server 5.0\bin\mysqld-nt" --defaults-file="C:\Program Files\MySQL\MySQL Server 5.0\my.ini" MySQL

When the service is installed from the commandline using the --install option, the quotes appear before the --defaults-file= instead of around just the value:

"C:\Program Files\MySQL\MySQL Server 5.0\bin\mysqld-nt" "--defaults-file=C:\Program Files\MySQL\MySQL Server 5.0\my.ini" MySQL

This doesn't cause problems for the server, as the defaults-file is used appropriately.  However, the difference can cause problems for tools such as MySQL Administrator (see http://bugs.mysql.com/bug.php?id=27259 as an example) and there doesn't appear to be any specific reason for the difference.

How to repeat:
* Install MySQL 5.0 to default location and select to run as service.
* Check the executable path in the resulting Windows Service.
* Delete the service using mysqld-nt --remove
* Install the service using mysqld-nt --install MySQL --defaults-file="C:\Program Files\MySQL\MySQL Server 5.0\my.ini"
* Check the executable path in the resulting Windows Service.

Suggested fix:
Standardize the use of quotation marks between the installer and the command-line service installation.
[11 Oct 2007 8:31] Masa Asaka
I also had this problem and more information. If defaults-file included space like "Program Files", this problem occured. If it included with no space like "C:\MySQL\my.ini", it worked fine.
[30 Nov 2007 22:55] Kolbe Kegel
Workaround:

You can open MySQL Administrator without logging into a MySQL server by holding Ctrl and pressing "Skip" (the label is "Cancel" unless you hold Ctrl).

Then, open the Configure Service tab, ensure that Config Filename is set appropriately, make some change (and undo it if you don't want to keep it) in order to enable the Apply Changes button. When you click Apply Changes, MySQL Administrator will modify the Windows service so in a way that it will be able to read later.

Alternatively, you can use the "sc" command-line tool to change the binary path for the service:

sc config MySQL binPath= "\"C:\Program Files\MySQL\MySQL Server 5.0\bin\mysqld-nt\" --defaults-file=\"C:\Program Files\MySQL\MySQL Server 5.0\my.ini\" MySQL"
[13 Feb 2008 0:11] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/42173

ChangeSet@1.2580, 2008-02-12 19:12:18-05:00, iggy@alf.(none) +1 -0
  Bug #27535 Installing Windows service with --defaults-file option - quotation marks issues
  - Remove offensive quotes.
[6 Aug 2009 14:24] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/80285

2798 Ignacio Galarza	2009-08-06
      Bug #27535 Installing Windows service with --defaults-file option - quotation marks issues
      - Remove offensive quotes.
[11 Aug 2009 14:32] Bugs System
Pushed into 5.1.38 (revid:davi.arnaut@sun.com-20090811142907-uu7nckpe93pii81v) (version source revid:davi.arnaut@sun.com-20090811142907-uu7nckpe93pii81v) (merge vers: 5.1.38) (pib:11)
[17 Aug 2009 16:40] MC Brown
A note has been added to the 5.1.38, 5.0.78, 6.0.4 and 4.1.26 changelogs: 

When installing the Windows service, using quotes around command-line configuration parameters could cause the quotes to incorrectly placed around the entire command-line option, and not just the value.
[14 Sep 2009 16:03] Bugs System
Pushed into 5.4.4-alpha (revid:alik@sun.com-20090914155317-m1g9wodmndzdj4l1) (version source revid:alik@sun.com-20090914155317-m1g9wodmndzdj4l1) (merge vers: 5.4.4-alpha) (pib:11)
[1 Oct 2009 5:58] Bugs System
Pushed into 5.1.39-ndb-6.3.28 (revid:jonas@mysql.com-20091001055605-ap2kiaarr7p40mmv) (version source revid:jonas@mysql.com-20091001055605-ap2kiaarr7p40mmv) (merge vers: 5.1.39-ndb-6.3.28) (pib:11)
[1 Oct 2009 7:25] Bugs System
Pushed into 5.1.39-ndb-7.0.9 (revid:jonas@mysql.com-20091001072547-kv17uu06hfjhgjay) (version source revid:jonas@mysql.com-20091001071652-irejtnumzbpsbgk2) (merge vers: 5.1.39-ndb-7.0.9) (pib:11)
[1 Oct 2009 13:25] Bugs System
Pushed into 5.1.39-ndb-7.1.0 (revid:jonas@mysql.com-20091001123013-g9ob2tsyctpw6zs0) (version source revid:jonas@mysql.com-20091001123013-g9ob2tsyctpw6zs0) (merge vers: 5.1.39-ndb-7.1.0) (pib:11)
[5 Oct 2009 10:50] Bugs System
Pushed into 5.1.39-ndb-6.2.19 (revid:jonas@mysql.com-20091005103850-dwij2dojwpvf5hi6) (version source revid:jonas@mysql.com-20090930185117-bhud4ek1y0hsj1nv) (merge vers: 5.1.39-ndb-6.2.19) (pib:11)