Start MAMP on login without any ugly hacks

Running MAMP on standard ports (80 for Apache and 3306 for mySQL) makes MAMP ask for a password on each start up. I would like MAMP to start automatically when I log in without requiring a password.

There are a few ways to do this posted around the web, but they all involve hacking MAMP in one way or another. There is an alternative. Create the following AppleScript:

do shell script "/Applications/MAMP/bin/ &" password "YOURPASSWORD" user name "YOURUSERNAME" with administrator privileges
do shell script "/Applications/MAMP/bin/ > /dev/null 2>&1"

Save it as a run-only application (to keep anyone from being able to open the script and read your password*). Then, add this script to your login items. That’s it, you’re done!

* As noted below, this is not secure. And, all attempts to make it secure result in a dialog box being displayed. So, either use this insecure script, or remember to start MAMP manually. I apologize for my mistake.

One Reply to “Start MAMP on login without any ugly hacks”

  1. Please note that this is absolutely not secure in any way; despite saving as “run only”, it’s still trivial to read the hardcoded password out of the script.

    You can find an explanation of this and examples of how to do it in a more secure fashion in the comments on, where this post is duplicated:

    Please please update your post to contain the improved code or edit it to explicitly say this is not secure so that someone who doesn’t read comments won’t be misled into thinking it’s safe.
    PCheese at 04/22/2010 12:03:50 am

Leave a Reply