One challenge is that often MySQL can only be run with administrative/root privileges.
On Linux and Solaris you can use 'gksu' to start a program as root, and a dialog will appear asking you for the root password. So if you right-click on the MySQL node and choose Properties and then select the Admin tab, you can make gksu the command name and the actual command to start and stop MySQL is part of the command arguments. Here is a screen shot to give you the idea:
Now, gksu doesn't exist on Mac. The command to bring up a dialog for the administrator password is somewhat complex. So I've written a little script called "macsu" that looks like this:
#!/bin/sh/usr/bin/osascript -e "do shell script \"$@\" with administrator privileges"Then in your Properties window you can do the following:
Et, voila, you get a prompt when you run the start command:
Note that my 'macsu' command doesn't handle "--" options well, so if you want to do "--console" you might have to wrap your mysql start command in your own script file, and then invoke that file from macsu.
To be honest I have no idea what you can do on Windows. Does anyone have any tips?
2 comments:
It works if the macsu script is correctly wrapped, like
#!/bin/sh
/usr/bin/osascript -e "do shell script \"$@\" with administrator privileges"
Thanks David. It works but the script must be correctly wrapped, like
#!/bin/sh
/usr/bin/osascript -e "do shell script \"$@\" with administrator privileges"
Post a Comment