thumb

After changing the default password for the MySQL root user, we should not forget to edit the phpMyAdmin configuration file. But how do this if we use the MAMP app from appsolute GmbH for local web development on our macOS device. In this tutorial, I’ll show you how to configure phpMyAdmin from the MAMP installation to use an actual password of the MySQL root user.


I’m using version 5.1 of the MAMP app, but in your case there can be any other version of the MAMP app. If you use the non-standard version of the app, but the PRO one, then in the following steps, replace “MAMP” with “MAMP PRO”, respectively.

Let’s begin

All we need to do is edit the phpMyAdmin configuration file from the MAMP installation. This is a really easy process. To do this we have two methods. The first method is using Finder and the TextEdit app, and the second is using the Terminal app. Use the one that is convenient for you.

Now, step by step guide.


In this solution we will use the Finder and the TextEdit app. You do not need to download and install anything, because it is already built into every macOS.

  1. If the MAMP app is running, click the Stop Servers button and quit the app.

  2. In the Finder, go to the folder Applications -> MAMP -> bin -> phpMyAdmin.

  3. Open the file config.inc.php in a text editor. As a text editor, I use the TextEdit app, but you can use any other editor. The contents of the file may seem complicated in understanding, but do not worry, we will not change a lot of things.

  4. Use the search to find the line below. In my case, this line was 87th.
    $cfg['Servers'][$i]['password']      = 'root';          // MySQL password (only needed
    
  5. Replace 'root' with an actual password of the MySQL root user.

  6. Save the changes and close the file config.inc.php.

  7. Launch MAMP and click the Start Servers button.

  8. Try to access the phpMyAdmin web page through the Safari browser.

    The phpMyAdmin web page located at localhost/phpMyAdmin/index.php.



This is another method to do the same thing as in the previous solution (№1), but with use the Terminal app. You do not need to download and install anything, because it is already built into every macOS.

  1. If the MAMP app is running, click the Stop Servers button and quit the app.

  2. Launch the Terminal app from the Utilities folder of your Applications folder, or use Spotlight to find it.

  3. Enter the command below to open the file config.inc.php. As a text editor, I use the nano, but you can use any other editor.
    nano /Applications/MAMP/bin/phpMyAdmin/config.inc.php
    

    The contents of the file may seem complicated in understanding, but do not worry, we will not change a lot of things.

  4. Use the search to find the line below. In my case, this line was 87th.
    $cfg['Servers'][$i]['password']      = 'root';          // MySQL password (only needed
    
  5. Replace 'root' with an actual password of the MySQL root user.

  6. Save the changes and close the file config.inc.php.

  7. Launch MAMP and click the Start Servers button.

  8. Try to access the phpMyAdmin web page through the Safari browser.

    The phpMyAdmin web page located at localhost/phpMyAdmin/index.php.

Conclusion

That’s it, you’re done. Now you have configured phpMyAdmin to use an actual password of the MySQL root user. So simple isn’t it?

I hope this article has helped you learn how to configure phpMyAdmin from the MAMP installation to use an actual password of the MySQL root user. If this article helped you then please leave a comment :smiley:

Thanks for reading!