Diagnosing MAMP's Root Access Denied Error
If you are staring at the error 1045 - Access denied for user 'root'@'localhost' (using password: YES) in phpMyAdmin, your immediate assumption should be that the default credentials haven't changed. This is a common misconception with local development environments like MAMP. The fact that you can still run /Applications/MAMP/Library/bin/mysql without a password suggests the MySQL service itself is running and accepting unauthenticated connections for specific users, but the root account has stricter validation rules enabled.
The discrepancy between your phpMyAdmin configuration and the terminal session is the smoking gun. Your config.inc.php explicitly sets $cfg['Servers'][$i]['auth_type'] = 'config', meaning it attempts to authenticate using the hardcoded password 'root'. However, when you invoke the MySQL client directly via the MAMP library path, the error shifts to Access denied for user 'boneill'@'localhost' (using password: NO).
This specific username, boneill, is the default system account created by macOS during the installation of the MAMP bundle. It differs from the standard MySQL root user found in production environments. In many MAMP configurations, the boneill user is intended for internal scripts or legacy connections but often lacks a password set by default. When you run the terminal command without arguments, the client tries to connect as boneill with no password, which fails because the account is either locked or requires authentication now that MAMP has updated its security defaults.
To resolve the phpMyAdmin issue, you must ensure the configuration matches the actual state of the MySQL instance running inside MAMP. If you have never changed your password and MAMP hasn't prompted for one, it is highly likely that the root user's authentication plugin or password hash has been updated, or the account was locked to prevent unauthorized access.
The most reliable fix is to stop relying on hardcoded credentials in config.inc.php. Instead, use HTTP or cookie-based authentication, which allows you to enter your current password dynamically in the browser. Update your configuration as follows:
$cfg['Servers'][$i]['auth_type'] = 'http'; // or 'cookie'
$cfg['Servers'][$i]['user'] = ''; // Leave empty for http/cookie auth
$cfg['Servers'][$i]['password'] = ''; // Leave empty as well
Alternatively, if you prefer to keep config authentication, you must verify the actual password for the root user. You can do this by launching the MySQL client with the MAMP binary and checking the status of the root account:
/Applications/MAMP/Library/bin/mysql -u root -p
When prompted for a password, try entering your known passphrase. If you are unsure, you can reset it using the ALTER USER command while logged in as the boneill user or another admin account if available:
ALTER USER 'root'@'localhost' IDENTIFIED BY 'your_new_secure_password';
FLUSH PRIVILEGES;
Once the password is confirmed, update your phpMyAdmin configuration file with the exact username (root) and the newly verified password. Remember that MAMP often manages its own MySQL instance separate from macOS's system-wide MySQL. Ensure you are editing the config.inc.php located in the MAMP root directory, not one installed globally on your system.
Another potential pitfall is the authentication socket or host specification. While localhost usually implies a TCP/IP connection, local setups often rely on Unix sockets. However, phpMyAdmin defaults to TCP for remote compatibility, which should work fine unless the socket permissions are misconfigured. If you switch to cookie-based auth, ensure your browser's session cookies are enabled and that no external firewall or proxy is intercepting the MAMP HTTP server requests.
Ultimately, this error is a symptom of a security update or a configuration drift within the MAMP environment. By moving away from static credentials in the config file or resetting the root password to match the current database state, you restore full administrative access without compromising the integrity of your local development stack.