Bug #687 Bug submission and fix: mysqld NT service doesn't work if path to exe contains
Submitted: 19 Jun 2003 14:01 Modified: 23 Jul 2003 18:14
Reporter: Miguel Solorzano Email Updates:
Status: Closed Impact on me:
Category:MySQL Server Severity:S2 (Serious)
Version:All OS:Microsoft Windows (Windows)
Assigned to: MySQL Verification Team CPU Architecture:Any

[19 Jun 2003 14:01] Miguel Solorzano
If the path to the mysql server executable (mysqld.exe, ...) contains spaces, then the service does not start. The problem is that the path to the executable is not surrounded with quotes when stored in the Windows registry

How to repeat:
- install mysql in C:\Program Files\msyql
- register the service:
  cd C:\Program Files\mysql\bin
  msyqld --install mysql --defaults-file="C:\Program Files\mysql\my-medium.cnf"
  net start mysql
- this produces the following error:
The service is not responding to the control function.

Suggested fix:
- install mysql in a directory with a path name without spaces.
- if the previous fix is not an available option, patch the source code for mysqld:
  The faulty file is sql/mysqld.cpp. For version MySql 4.0.13, replace lines 2577-2578:
      *strxnmov(file_path + length, sizeof(file_path)-length-2, " ",
                argv[3], " ", argv[2], NullS)= '\0';

  with these lines:
      *strxnmov(file_path + length, sizeof(file_path)-length-2, " \"",
                argv[3], "\" ", argv[2], NullS)= '\0';

  and recompile.
[5 Jul 2003 16:56] MySQL Verification Team
Patch submitted for approval.
[23 Jul 2003 18:14] MySQL Verification Team
ChangeSet  1.1544 03/07/23 21:57:44