Bug #19701 unable to start the server on Win32 via command line unless using --console arg
Submitted: 10 May 2006 22:43 Modified: 12 Sep 2006 21:49
Reporter: Erica Moss Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:5.0.21-community OS:Windows (win32 - XP SP2)
Assigned to: Iggy Galarza CPU Architecture:Any

[10 May 2006 22:43] Erica Moss
Description:
According to our manual and other references, you should be able to invoke the server manually on windows using either mysqld.exe or mysql-nt.exe.  If the arg --console is passed to it, errors should go to the console.  If it is ommitted, errs should go to a .err file in the data directory.

Currently when these programs are run they return immediately, the server isn't started, and the error log is blank.  If the --console switch is passed however, it will start successfully.  Note - the mysql service is installed, but not started.

How to repeat:
attempt to start the server from a command prompt session - either:
mysqld OR
mysqld-nt
sans arguments
[10 May 2006 22:56] Erica Moss
modified title
[10 May 2006 23:18] MySQL Verification Team
Thank you for the bug report. What you meant with can't start, for example
I started without any arguments:

c:\mysql\bin>mysqld-nt

and the server was started how shows the tasklist:

c:\mysql\bin>tasklist

Nome da imagem            Identi Nome da sessão    Sessão# Uso de memór
========================= ====== ================ ======== ============
System Idle Process            0 Console                 0         28 K
System                         4 Console                 0        228 K
<cut>
mysqld-nt.exe                460 Console                 0      9.308 K

and the log.err file created. If you meant that the prompt command
screen should be closed then I can confirm even I believe this is
an OS issue which not permits the below code to works:

#ifdef __WIN__
  if (!opt_console)
  {
    freopen(log_error_file,"a+",stdout);
    freopen(log_error_file,"a+",stderr);
    FreeConsole();				// Remove window
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  }

The above worked on Win9X.
Thanks in advance.
[10 May 2006 23:59] Erica Moss
I can't speak for win9.x.  I haven't run those for a long time.  I'm running XP SP 2.

I just tried this again with both mysqld, and mysqld-nt.  The prompt actually does return when I invoke them without switches, which as you mention, it shouldn't do.  It definately isn't running, because I can't connect with a client, or mysqladmin, it also isn't present in the task list.

Another point of interest is that if I pass the --defaults-file arg to specify the option file, it will also start this way.  It just won't work without any args
[11 May 2006 0:00] Erica Moss
modified OS field
[11 May 2006 0:37] Erica Moss
Out of curiosity I tried this on a much slower machine running Win2K.  When I follow the steps I described, it is apparent that it actually does start the server(s) and it runs for a few seconds, just long enough for it to join the tasklist, but then it exits.  No errors are generated to the log (which I'm assuming is 'hostname'.err in the data dir).
[11 May 2006 1:36] MySQL Verification Team
Screenshot showing server and mysql connected

Attachment: bug19701.PNG (image/png, text), 16.42 KiB.

[11 May 2006 1:38] MySQL Verification Team
I attached a screenshot showing the server and the mysql client connected.
Please see \data\hostname.err for any error message which clarify why
the server exits. I tested also on XP SP2.

Thanks in advance.
[11 May 2006 16:00] Erica Moss
I'm surprised you're having difficulty reproducing this.  There has to be some difference between your configuration and mine.  Are you using the .21 CE release?  Have you made certain that mysql is not already running as a service?

I just did a complete uninstall/reinstall including removing the data dir with the GA build on my Win2K box and it happens exactly as I describe.  Enter either mysqld, or mysqld-nt with 0 arguments and it exits almost immediately.

There are no errors generated to the .err file.  It is blank (I zeroed it before running the test)
[11 May 2006 17:26] MySQL Verification Team
Yes I tested with the server installed by the installer, I verified not any
other server is running. I am assigning this bug to Valeriy for he to try too.
[23 May 2006 11:45] fabrice khedadi
Hi, I've got same issue and running XP SP2. The server 5.0.21-win32 doesn't started and return Error:0.
[6 Jun 2006 15:47] Valeriy Kravchuk
Yes, MySQL server (version 5.0.20a, 5.0.21, whatever) can be started from the command line on XP SP2 with --console option, and it works OK. If you simply run it as mysqld.exe, without options, it is running for some time, allocates about 1.4MB of memory, then, silently, exits. Just as described.
[12 Sep 2006 21:49] Iggy Galarza
I downloaded the mysql-5.0.24a noinstall community edition on Windows XP SP2.
I was able to start the mysqld.exe process and connect to it with mysql.exe with no problem.