Mac OS X - fire up Apache/Mysql without prompting for password
The thread Starting Xampp Control Panel without password lists two possible solutions :
- Write scripts that start and stop XAMPP, specifying the password in the scripts.
The two scripts are included in the thread. - Edit the
/etc/sudoers
file, configuring thatsudo /Applications/XAMPP/xamppfiles/xampp start
doesn't need a password.
Problem
Mac OSX asks you for your password because XAMPP is trying to run the *nix command [sudo](http://en.wikipedia.org/wiki/Sudo)
. This can be overcome by one of two ways:
a. Allow ALL sudo
commands to be run without a password.
b. Allow ONLY the XAMPP command to be run with no password.
Solution
To use one of these solutions, do the following:
- Open Terminal.app (I like to hit Command+Space, then type "Terminal.app", then hit Enter).
- Run
sudo nano /etc/sudoers
. Append the following text to the file, where username is your short username (type
whoami
into the terminal to get it):- For option a:
%username ALL=(ALL) NOPASSWD
- For option b:
%username ALL= NOPASSWD: /Applications/XAMPP/xamppfiles/xampp
Press Ctrl+x, and save when prompted.
Note that on OSX Mavricks, you may have to add a % sign before the username (in /etc/sudoers
).