Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

share|improve this question

1 Answer 1

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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.