|Jun 29, 2009, 03:39 AM||#1|
Making a script to start and stop mySQL.
I manually installed mySQL 5.1 so I can't use the pref pane that I would normally get when installing mySQL as a installer package. So I would like to make two scripts (".start" and ".stop") that will live in my home folder, so I can quickly start and stop them when open terminal. I kinda have an idea on how to make it but I don't know how to have the script enter my admin password when it is prompted (or if thats even possible).
the two commands to start and stop it are as follows:
sudo launchctl load -w /Library/LaunchDaemons/com.mysql.mysqld.plist
sudo launchctl unload -w /Library/LaunchDaemons/com.mysql.mysqld.plist
EDIT: Nevermind I think I figured it out, Just had to change some permissions.
EDIT #2: So they work just fine but now I have that natural feeling to make it better. I currently have two scripts, one for starting, and one for stopping. How would I go about rolling them into one single script called ".mysql" and it will test if the mySQL server is already running (or not running) then execute the needed command. Do any of you know what is returned if one of these commands failed to execute?
I would think that I could use
Last edited by NRose8989; Jun 29, 2009 at 04:07 AM.
|Thread Tools||Search this Thread|
|thread||Thread Starter||Forum||Replies||Last Post|
|Start/stop a shell script loop||hakonandersson||Mac Programming||2||May 29, 2013 06:58 AM|
|How to Make Firefox Stop Lagging and Give Script Errors||iPowers||Mac Applications and Mac App Store||2||Jan 21, 2013 08:30 PM|
|How can I stop all my files making backups of themselves?||fredthe3rd||Mac OS X 10.7 Lion||1||Oct 30, 2012 06:22 PM|
|My script is making it impossible to quit an app it works with||Mephistopelus||Mac Programming||9||Oct 17, 2012 09:39 AM|
All times are GMT -5. The time now is 02:20 AM.