How do I change the MAMP MySQL password on the Mac?
2 Answers
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
-
I get an error saying 'Access denied for user 'root'@'localhost' (using password: YES)' 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. 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 -
1I updated the phpmyadmin config.inc.php file what are the other config files that I must update? 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
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".
Then enter the new password in /Applications/MAMP/bin/phpMyAdmin/config.inc online 86 delete root and replace with your new password.
Then open /Applications/MAMP/bin/mamp/index.php and on line 5 change the second root to your new password.
Then open /Applications/MAMP/bin/stopMysql.sh and here look for proot and replace the root with your new password. leave the p.
Done.
-
Quick note: that path should read "/Applications/MAMP/bin/phpMyAdmin/config.inc.php". Nov 22, 2020 at 23:19