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.
1. Add MySQL server to the IDE and set in "Admin Properties" tab: Start command: $MySQL\bin\mysqld.exe Start arguments: --console Stop command: $MySQL\bin\mysqladmin.exe Start arguments: -u root shutdown 2. Start it. IDE will be automatically connected to the server. 3. Rightclick MySQL server's node and choose "Stop". Result: After some time message that server can't be stopped appears. If user keeps waiting server still can't be stopped. It was able to stop server with such admin properties before.
One question: is there anything written to the output window? I've been trying to reproduce on my Mac, but have configuration problems; I'm trying it now in my VMWare XP virtual machine.
I see the same problem, using 'net start' and 'net stop' - I can run from the command window, but it just does nothing in NetBeans, and there is no output in the output window.
David, there is no output in the output window for me too.
Now I can't reproduce it. All I did was add some logging statements that weren't even activated during the run. I'll try removing them and see if that makes a difference, but I doubt it. Sigh...
Nope, works for me now, no matter what I do. I think the other thing that change is I rebooted my Windows VM. Perhaps you can try rebooting and see if the problem goes away for you. There have been bugs logged in the past where an attempt to connect to MySQL on Windows hangs, and I wonder if MySQL can get "hung up" on Windows. Did you try to start and stop from the command line using the same commands?
I tried after reboot, the same issue. I tried also to stop MySQL with the same arguments from command line and was successful. Before I didn't have such problem. And I'm not sure that mysqladmin is running, at least I don't see it in Windows Task Manager. Though it can disappear too quickly and therefore I don't see it. Everything was fine before adding functionality with "keep waiting". And I'm constantly able to reproduce this issue. But sometimes MySQL server is stopped, I can't say exact steps and other circumstances since I don't know them. :) If it helps, we can setup VNC session and try to reproduce. Anyway, I'll try with latest build and will see. But I was able to reproduce this issue on several latest builds, so I don't think that problem has gone.
At least for my Linux installation, to shutdown MySQL, it's required to provide arguments. Stop command: /home/jbaker/bin/mysql-5.0.67-linux-i686/bin/mysqladmin Arguments: -pmysql shutdown If I enter this stop command with these arguments from the commandline, then MySQL is shut down. However, it won't shutdown with or without these arguments. Without arguments, the usage of the mysqladmin command is listed in the Output window: /home/jbaker/bin/mysql-5.0.67-linux-i686/bin/mysqladmin Ver 8.41 Distrib 5.0.67, for pc-linux-gnu on i686 Copyright (C) 2000-2006 MySQL AB This software comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to modify and redistribute it under the GPL license Administration program for the mysqld daemon. Usage: /home/jbaker/bin/mysql-5.0.67-linux-i686/bin/mysqladmin [OPTIONS] command command.... -c, --count=# Number of iterations to make. This works with -i (--sleep) only. -#, --debug[=name] Output debug log. Often this is 'd:t:o,filename'.
Apparently, I need to provide both the username and password as arguments for the Stop command, even though I provided both the username and password in the Basic properties section Stop command: /home/jbaker/bin/mysql-5.0.67-linux-i686/bin/mysqladmin Arguments: -uroot -pmysql shutdown (Stop works) If the username and password are omitted from Arguments then an error is printed to the Output window: Stop command: /home/jbaker/bin/mysql-5.0.67-linux-i686/bin/mysqladmin Arguments: shutdown Result of attempting to stop: /home/jbaker/bin/mysql-5.0.67-linux-i686/bin/mysqladmin: shutdown failed; error: 'Access denied; you need the SHUTDOWN privilege for this operation'
Roman, 1) from commandline, are you executing the shutdown command as root or mysql user? 2) What is the command you type from commandline to shutdown? 3) From NetBeans, when you try to shutdown, do you see this error about privileges ? /home/jbaker/bin/mysql-5.0.67-linux-i686/bin/mysqladmin: shutdown failed; error: 'Access denied; you need the SHUTDOWN privilege for this operation'
1) from commandline, are you executing the shutdown command as root or mysql user? I reproduce this on Windows XP, so there is no mysql user and I'm executing the shutdown command as root. 2) What is the command you type from commandline to shutdown? "mysqladmin.exe -u root shutdown". And this command works from commandline fine. It worked fine before in IDE too, but not now. 3) From NetBeans, when you try to shutdown, do you see this error about privileges ? /home/jbaker/bin/mysql-5.0.67-linux-i686/bin/mysqladmin: shutdown failed; error: 'Access denied; you need the SHUTDOWN privilege for this operation' No, I don't see this error. Probably because I reproduce it on Windows XP.
> 2) What is the command you type from commandline to shutdown? "mysqladmin.exe -u root shutdown". And this command works from commandline fine. It worked fine before in IDE too, but not now. At least on Linux I have to provide the arguments -uroot -pmysql shutdown (no space between -u and the username and same with the password)
Stop is not working On Windows XP, with these settings (no MySQL password configured) Stop command: C:/Program Files/MySQL/MySQL Server 5.0/bin/mysqladmin.exe Arguments: -uroot shutdown Stop works from commandline: c:\> mysqladmin -uroot shutdown
I did a little debugging and the start command and arguments are getting passed. I tried removing spaces from the path to the start command but that didn't seem to make any difference. Next, I disabled the antivirus and found that now Stop works ! However, it looks like the antivirus must be disabled prior to starting NetBeans. I don't know if there's any way to workaround the antivirus other than documenting how to disable checking Java processes
And the Stop argument for now root password should be -uroot (no spaces between -u and root) We may need to release note this as the only option ?
Antivirus is blocking the execution of mysqladmin from NetBeans. We need to release note this.
I agree that antivirus is the problem, but a release not is going to be pretty unhelpful. What about my suggestion that the error message when stop fails be appended to include a suggestion (if it's windows) that perhaps antivirus is blocking the stop from succeeding?
I didn't see any other suggestion. That's why I marked as RELNOTE and marked this as WONTFIX. The suggestion is to add a message to the Output window? Any new message will be added to bundle.properties, so this constitutes as a UI change and then the late UI change process will have to be followed ?
In general, though, I think we need some note about excluding MySQL directories from being scanned, as recommended in the MySQL docs: http://dev.mysql.com/doc/refman/5.0/en/windows-installation.html
Actually for me MySQL can be stopped (but very rarely). But in the same time, I'm very rarely able to stop MySQL with disabled antivirus. Can firewall be the reason also?
Actually, now on my Windows XP laptop, there is some pattern if MySQL is already running, regardless of whether the antivirus is running. 1) Start MySQL from NetBeans 2) Exit NetBeans, restart, then choose Stop Result - stop succeeds 3) Repeat 1 and 2 Result - stop fails Roman, is this the same pattern you're seeing? Also, after stopping the server successfully, when attempting to start MySQL again the MySQL node's context menu is not opening and other nodes seem to be not responding immediately. So, it appears a process or processes have not completed.
Yes, this pattern works for me. But I can reproduce even restart. I started NetBeans with fresh userdir and tried to start and stop MySQL server in the same session and then I got error.
Roman, > Yes, this pattern works for me. OK, we agree on the steps in desc21. > But I can reproduce even restart. > I started NetBeans with fresh userdir and tried to start and stop MySQL server in the same session and then I got error. Maybe I didn't wait long enough for the error message to appear. What does the error message say exactly, can you attach a screenshot or paste the text here.
If I set the path to the Administration Tool and supply the arguments -uroot shutdown then start the Administration tool then shutdown works fine. So the process to stop MySQL must not be executing correctly after starting MySQL from NetBeans
For testing purposes, I added a sleep of 10 seconds to MySQLDatabaseServer.stop() and now Stop works. It appears "proc" is terminated as soon as proc.runProcess(...) terminates (almost immediately) I don't know if adding a short sleep is the right fix or waitForStopAndDisconnect() needs to be executed prior to proc.runProcess(...)
4c1484fedff0
On Linux, stop works and the progress bar stops On Windows, stop works, but the progress bar continues looking into this ...
b7238e4c0d48 progress bar is terminating now. I should have used waitFor, not wait to wait for the process to complete
Verified with build 081002.
Thanks for catching this and fixing it. DVC01 What happens if the process to stop MySQL (for whatever reason - remember it's user-configurable) never terminates? Then the progress bar will sit there indefinitely, and the user has no way to cancel it. ProgressHandleFactory has a createHandle method that takes a Cancellable. This allows the use to cancel a progress bar. In the cancel handler we can do proc.destroy(). Can you please add that? DVC02 The logic of combining checkRunning() and waitFor() doesn't fully make sense. It's more than possible, for instance, that the stop process exits before the server stops. Or that the server stops before the stop process exits. Note that we call stop() and it runs asynchronously. Then we have other logic (see StopManager.waitForStopAndDisconnect()) that wait for the server to actually stop. Also, you only need to synchronize on proc when you are using Object.wait(), not Process.waitFor(). So I think you can just do try { proc = runProcess(getStopPath(), getStopArgs(), true, Utils.getMessage("LBL_MySQLOutputTab")); // wait for the process to stop proc.waitFor(); } finally { if (proc != null) { proc.destroy(); } }
ok done f96430a5cb00 but should be re-verified
f96430a5cb00
Looks good, thanks.
Integrated into 'main-golden', will be available in build *200810031107* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/f96430a5cb00 User: John Baker <jbaker@netbeans.org> Log: #147989 add cancellable to the ProgressHandleFactory
Verified with build 081003. Again, John. ;)