Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
33 lines (23 sloc) 1.97 KB



Changing or re-setting the password for MAMP's MySQL root user necessitates updating hard-coded references to the old password in several Bash scripts shipped with MAMP for macOS.

As of MAMP 5.x these files are:

  • /Applications/MAMP/bin/
  • /Applications/MAMP/bin/
  • /Applications/MAMP/bin/
  • /Applications/MAMP/bin/
  • /Applications/MAMP/bin/
  • /Applications/MAMP/bin/phpMyAdmin/

Instructions on changing the password for MAMP's MySQL root user and how to manually update each of these files can be found at Changing the MySQL Root User Password in MAMP.

Purpose is a Bash script that automates updating these files with the new password and is run from the command line.


  1. Download
  2. Open the Terminal application in macOS.
  3. At the shell prompt
    1. type chmod +x /path/to/ and press enter to make the script executable
    2. type /path/to/ OLDPASSWORD NEWPASSWORD replacing OLDPASSWORD and NEWPASSWORD as appropriate and press enter to run the script

The script changes all occurrences of OLDPASSWORD with NEWPASSWORD in the designated files making a backup (.bak) of each file in its parent directory before any changes are made.

If either the OLDPASSWORD or the NEWPASSWORD are omitted, the script will exit with the error ERROR: Usage is OLDPASSWORD NEWPASSWORD.

If OLDPASSWORD is not found in an individual file the script will display the message WARNING: Could not find old password 'OLDPASSWORD' in /Applications/MAMP/bin/

If successful the script will display the message Updated /Applications/MAMP/bin/ with new password 'NEWPASSWORD' for each file updated.