This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 142094 - MySQL server can't be stopped
Summary: MySQL server can't be stopped
Status: VERIFIED FIXED
Alias: None
Product: db
Classification: Unclassified
Component: MySQL (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: David Vancouvering
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-07-29 16:26 UTC by Roman Mostyka
Modified: 2008-09-11 17:50 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Roman Mostyka 2008-07-29 16:26:36 UTC
1. Install NetBeans with bundled MySQL.
2. Rightclick MySQL server node and choose "Start". Server is started.
3. Rightclick MySQL server node and choose "Stop".

Result: Message "ERROR 1049 (42000): Unknown database 'stop'" appears in the output and MySQL isn't stopped.
Comment 1 David Vancouvering 2008-07-29 18:31:59 UTC
Hi, Roman.  Can you stop the server from the command line?  If so, what command and arguments do you use?  Does this
match what you have configured in the properties dialog for the MySQL node?
Comment 2 Roman Mostyka 2008-07-29 18:52:19 UTC
I don't use any command. I just kill process. :)
Comment 3 David Vancouvering 2008-07-29 20:39:07 UTC
It seems pretty clear to me the problem is that the stop command is incorrectly configured in NB.

See if you can use the command line to stop the server, using the same command that you is configured in the MySQL
properties dialog.  If you can't, find out what you can do to correctly issue the stop command, and then reconfigure
MySQL in NB to use that command and arguments.

Comment 4 Roman Mostyka 2008-07-30 10:58:15 UTC
In MySQL 5.1.26rc following works for me:
mysqladmin.exe -u root shutdown

Probably this issue should be reassigned to installer guys, because installer set default parameters for bundled MySQL.
Add to CC Dmitriy (dlipin).
Comment 5 David Vancouvering 2008-07-30 16:47:33 UTC
Unless they're doing some magic I'm aware of, I don't know how the installer team can set the default parameters for
start and stop, as this is done in my code and they have no access to it.

Please check the parameters set in the admin properties panel -- what are they set to in terms of command path and
arguments?  Where is MySQL getting installed with the bundle?

I had wanted to work with dlipin and the  installer team on fixing the MySQL bundle for the next release so that the
correct parameters get set, but it doesn't look like that's happening.  

Comment 6 Roman Mostyka 2008-07-30 17:27:40 UTC
MySQL is installed by default to C:\Program Files\MySQL\MySQL Server 5.0. Of course it is possible to set different path.
Command to start: C:\Program Files\MySQL\MySQL Server 5.0\bin\mysqld-nt.exe
Parameter to start: no
Command to stop: C:\Program Files\MySQL\MySQL Server 5.0\bin\mysqld.exe
Parameter to stop: -u root stop
Comment 7 David Vancouvering 2008-07-30 19:05:06 UTC
I think that's the correct solution for now.  I try to guess at the correct path, but if it's wrong, all you have to do
is change it.  Once we fix the bundle to set the system properties, then this shouldn't be an issue for bundled MySQL.
Comment 8 Roman Mostyka 2008-07-31 09:07:17 UTC
First of all I did mistake:
Command to stop: C:\Program Files\MySQL\MySQL Server 5.0\bin\mysql.exe (was mysqld.exe)
And I wrote about parameters, which are set now by installer (or something else, I don't know).
You said that parameters are set from your code. So I think we have to fix this issue, since "C:\Program
Files\MySQL\MySQL Server 5.0\bin\mysql.exe -u root stop" doesn't work at all, this command gives message "Database
'stop' doesn't exist" (or something like that). So this command is wrong. And moreover, if we have bundled MySQL server,
then we definitely know installation path, there is no need to guess, right?
And I don't think that it is a good idea to let customer change paths and parameters, when MySQL installed with NetBeans.
Comment 9 dlipin 2008-07-31 10:47:02 UTC
Roman, David,

I guess the right commands to stop the server (on windows) is:
mysqladmin.exe -u root stop.
Roman has already mentined it for 5.1.26rc (comment from Wed Jul 30 09:58:15 +0000 2008) - it also works for 5.0.51.

If the password has been set (e.g. 12345678), then the command should be different:
mysqladmin.exe -u root --password=12345678 shutdown
or
mysqladmin.exe -u root -p shutdown
In the latter case the user has to input the password using stdin.

In the MySQL bundle we install mysql as the service (with name MySQL50) so it`s easier to start and stop it using the 
system facilities:
net start MySQL50
net stop MySQL50
The advantage of those command that they do not require a password, they are simple and gives the self-explanatory 
output.
The disadvantage is that they can`t be used always : if the user installed MySQL using standalone installer and 
configured MySQL not to start as the windows service (or configured to use some custom service name - default is MySQL 
in the standalone installer) then those command can`t be used out-of-box...
Comment 10 David Vancouvering 2008-07-31 17:00:20 UTC
OK, it sounds like I am deriving the wrong stop command for a standard installation of MySQL on Windows, so we should
fix that. 

Regarding your comment that if it's bundled, we should know where it's installed and how to start and stop it, I totally
agree, and that is what Dmitry and I are working on as a separate issue.  So let's keep this issue about the fact that I
am configuring the stop command wrong for a standard XP installation.
Comment 11 David Vancouvering 2008-07-31 17:27:52 UTC
I don't believe this is a P2. The workaround is quite simple: fix the command arguments in the admin properties panel
for the MySQL node.  Please re-raise priority if this workaround doesn't work for some reason.
Comment 12 David Vancouvering 2008-08-19 01:30:40 UTC
OK, if the password has been assigned then there's not much I can do, but I can do by default "mysqladmin.exe -u root
stop".  If the password is required then there will be an error and the user can change the command to include "-p
password".

Comment 13 Roman Mostyka 2008-08-19 12:39:31 UTC
David, I wrote that for me "mysqladmin.exe -u root shutdown" works, not "mysqladmin.exe -u root -p stop".
Comment 14 Quality Engineering 2008-08-28 06:30:07 UTC
Integrated into 'main-golden', available in build *200808280201* on http://bits.netbeans.org/dev/nightly/
Changeset: http://hg.netbeans.org/main/rev/7887d1b4d07c
User: David Van Couvering <davidvc@netbeans.org>
Log: #142094: MySQL server can't be stopped
Comment 15 David Vancouvering 2008-08-29 08:00:24 UTC
Hi, Roman, please verify that this works correctly now with the default installation on Windows.
Comment 16 Roman Mostyka 2008-09-10 17:10:58 UTC
Where I can get latest bundled build?
Comment 17 Roman Mostyka 2008-09-11 17:50:47 UTC
Verified with build 080910.