Bug #77990 MySQL Server does not start if the service name contains a space.
Submitted: 7 Aug 2015 23:59 Modified: 27 Aug 2015 7:55
Reporter: Nathan Le Email Updates:
Status: Open Impact on me:
None 
Category:MySQL Server Severity:S4 (Feature request)
Version:5.6.26 OS:Windows (Windows 10)
Assigned to: CPU Architecture:Any
Tags: Configuring Server, Naming Service, services

[7 Aug 2015 23:59] Nathan Le
Description:
If you configure the service name with a space, it causes problems when trying to start the service for the first time. It says it has exceeded the 30000 ms timeout period set by Microsoft Windows when viewing the Event Viewer > Windows Logs > System > Error logs, which that is not the case since I literately started the service many times in a row and only counted to like 5 seconds each time before it stopped. Also, the progress bar only gotten about half way before it stopped and throwing this error:

Windows could not start the MySQL Server service on Local Computer.

Error 1053: This service did not respond to the start or control request in a timely fashion.

When I read too many arguments from the error log, which should be attached, this prompted me to reinstall the MySQL Server again and this time not put a space in the MySQL Server's service name. Now, since re-configuring will not work because it needs to check the root's password but the server is not running so it crashes the launcher (Note it has the JIT debugger that serves no help because it does not check to see if the server is running first).

How to repeat:
Install MySQL Server on Windows 10, not sure if it is just Windows 10 or if it is all Windows OS's, but feel free to give it a try, then when you name the default service name from "MySQL56" to "MySQL Server" it will cause problems when trying to start the server for the first time.

Suggested fix:
Either prevent the user from adding spaces in the service name textbox where it allows you to rename the default service name from "MySQL56" to whatever you like or add double quotes around the command line for the service name like you do for paths. Examples below.

Below is the service name without a space:
"C:\Program Files\MySQL\MySQL Server 5.6\bin\mysqld.exe" --defaults-file="C:\ProgramData\MySQL\MySQL Server 5.6\my.ini" MySQLServer

Below is the service name with a space and double quotes:
"C:\Program Files\MySQL\MySQL Server 5.6\bin\mysqld.exe" --defaults-file="C:\ProgramData\MySQL\MySQL Server 5.6\my.ini" "MySQL Server"
[8 Aug 2015 0:00] Nathan Le
Error Log

Attachment: DESKTOP-U7KOGA6.err (application/octet-stream, text), 42.61 KiB.

[8 Aug 2015 0:00] Nathan Le
Screenshot 1/3

Attachment: Screenshot 2015-08-07 18.14.00.png (image/png, text), 397.89 KiB.

[8 Aug 2015 0:00] Nathan Le
Screenshot 2/3

Attachment: Screenshot 2015-08-07 18.14.12.png (image/png, text), 168.74 KiB.

[8 Aug 2015 0:01] Nathan Le
Screenshot 2/3

Attachment: Screenshot 2015-08-07 18.14.16.png (image/png, text), 175.22 KiB.

[27 Aug 2015 7:55] Nathan Le
Scrap that idea about adding quotes around the service name.

Looking through all of the Services, I noticed that they have a service name and a display name. I was thinking of the display name by mistake for adding quotes around it, since I assumed that was what they called that service.

A better way would be to have two textboxes, one for the service name, which is the one that is already there that has the default MySQL56 text, and the other for the display name. Now, the display name textbox will be hidden by default and will always use whatever text is in the service name's textbox if it's hidden and/or if the text is the same as the service name's textbox. Also, the service name textbox should NOT allow any spaces; or it could just remove all the spaces once that textbox loses focus. This will prevent any issues that arise on the next setup page when it is trying to start the server for the first time.