0

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

2 Answers 2

0

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

5
  • I get an error saying 'Access denied for user 'root'@'localhost' (using password: YES)'
    – user823527
    Mar 24, 2012 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, 2012 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. Mar 24, 2012 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, 2012 at 0:53
  • A good idea might be to search the entire directory for files containing <OLDPASSWORD>. Mar 27, 2012 at 12:55
1
  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.

1
  • Quick note: that path should read "/Applications/MAMP/bin/phpMyAdmin/config.inc.php".
    – Sebastian
    Nov 22, 2020 at 23:19

You must log in to answer this question.

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