Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How do I change the MAMP MySQL password on the Mac?

share|improve this question
up vote 0 down vote accepted

How can I change the password of the MySQL root user?

Open the Mac OS Terminal Application (located in "/Applications/Utilities") and enter the following command line:

/Applications/MAMP/Library/bin/mysqladmin -u root -p password <NEWPASSWORD>

replace <NEWPASSWORD> with your new password. Please bear in mind that you also have to change the phpMyAdmin configuration and probably your own php-scripts to use the newly created MySQL password. For changing the phpMyAdmin configuration edit the following file and update the password:

/Applications/MAMP/bin/phpMyAdmin-X.X.X/config.inc.php

Source: MAMP FAQ

share|improve this answer
    
I get an error saying 'Access denied for user 'root'@'localhost' (using password: YES)' – user823527 Mar 24 '12 at 18:54
    
I changed succesfully changed the password with /Applications/MAMP/Library/bin/mysqladmin -u root -p password [NEWPASSWORD]. But the MAMP start page could not start the MySQL server with the new password. It does if I change the password back. – user823527 Mar 24 '12 at 19:08
    
Yes, sorry, I missed the <NEWPASSWORD>-part, it's fixed now. MAMP cannot longer connect to your database, because you have to change every occurrence of your old password in all the config files. – 0sh Mar 24 '12 at 19:13
1  
I updated the phpmyadmin config.inc.php file what are the other config files that I must update? – user823527 Mar 27 '12 at 0:53
    
A good idea might be to search the entire directory for files containing <OLDPASSWORD>. – 0sh Mar 27 '12 at 12:55
  1. The MAMP servers must be running while you make your changes in terminal. Note: after you enter your new password it will ask you for your password. Enter the old one. Probably "root".

  2. Then enter the new password in /Applications/MAMP/bin/phpMyAdmin/config.inc online 86 delete root and replace with your new password.

  3. Then open /Applications/MAMP/bin/mamp/index.php and on line 5 change the second root to your new password.

  4. Then open /Applications/MAMP/bin/stopMysql.sh and here look for proot and replace the root with your new password. leave the p.

Done.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .