After several days of beating my head on this I discovered the solution. It took a while to put the pieces together because the MAMP installation is a bit different then a standard mysql installation. I still don't understand a few of the details but here we go.
Even though I was logging in as root the reality was that I was an anonymous user indicated by the above and ''@'localhost'. So there is obviously a permissions error which has three parts: username, password, and host. So something about my root account changed (I believe it was the password), but how the whole thing responded was a bit wonky, as in instead of telling me my password and username combo was incorrect, I was getting logged in with no permissions. I believe I exacerbated this situation a bit by running some commands like the below.
mysqladmin -u root password 'password'
In the end here is what I did, and I want to make clear this is the instructions for a MAMP installation on OS X, although I'm sure they can be easily adapted for Windoz.
Big thanks to this thread for helping me see the light on how to resolve this.
- Open the Activity Monitor.
- Shut down MAMP
- Ensure that mysql is shut off in Activity Monitor. Now, you might see a _mysqld process running which might be the default OSX mysql running.
Run the following command, replacing the port number with the one you use. This will start mysql minus the user permissions.
/Applications/MAMP/Library/libexec/mysqld --skip-grant-tables --port=8889 --socket=/Applications/MAMP/tmp/mysql/mysql.sock
In your console login to mysql with no creds.
mysql
Run the below commands.
FLUSH PRIVILEGES;
GRANT ALL ON *.* TO 'username'@'localhost' IDENTIFIED BY 'password';
Shut down mysqld and restart it without the skip-grant-tables option
Login to mysql to confirm that things work.
You will need to fix your phpmyadmin as well. I want to preface this with for some reason I do not understand these changes to not propagate quickly, and suddenly just start working.
Go into /Application/MAMP/bin/phpMyAdmin/config.inc.php and enter the correct credentials for your newly created login. Make sure they are exact including host.
Lastly after phpmyadmin is working go into the mysql.user table and see where things could have gone wrong. It's important to understand what got messed up.
There are a few things about what happened in the above that I would love some clarification on, like why MAMPs phpmyadmin credential changes do not work immediately.
Hope all this helps!