slurpage



How to change the default MAMP MySQL Password

When you are changing the default user/password from root/root, you need to do two things. Only the first is documented in the MAMP start page FAQ, but if you don’t do the second then you get an error message when you try to access anything from the MAMP start page.

  

  1. Use command line to change the password (as documented in the MAMP start page FAQ)

    Open the terminal and type the following:
    /Applications/MAMP/Library/bin/mysqladmin -u root -p password [NEWPASSWORD]

    It will ask for the current password after you hit enter. Once you have entered that, the MySQL password is changed.

  2. Open a text editor and change the password in the three following files:
    • /Applications/MAMP/bin/phpMyAdmin-X.X.X/config.inc.php

      Find the line that reads…
      $cfg['Servers'][$i]['password']      = 'root';
      …and change the value 'root' to your new password, retaining the quotes.

    • /Applications/MAMP/bin/mamp/index.php

      Find the line that reads…
      $link = @mysql_connect(':/Applications/MAMP/tmp/mysql/mysql.sock', 'root', 'root');
      …and change the last parameter to your new password.

    • /Applications/MAMP/bin/stopMysql.sh

      Replace the -proot with your password. (If you don’t change this one you can have zombie mysqld’s running after you thought you stopped the server)

Posted via email from adlatitude | Comment »