Saturday, January 26, 2008

Reseting your mysql password in MAMP on leopard

I was searching everywhere for a config file to edit, googling "mysql reset password leopard MAMP" and couldn't find it.

Then I found this page on reseting apache/mysql/php on Leopard and one of the comments (Lazeez's) got me close:

/usr/local/mysql/bin/mysqladmin -u root password ’somepassword’

where ’somepassword’ is the password you want for the root user of Mysql.

This doesn't work for MAMP obviously, but it led me to search for the "mysqladmin" file. I found it at


Therefore, the following command, pasted into terminal did the trick:

/Applications/MAMP/Library/bin/mysqladmin -u root -p password ’somepassword’

It will ask you for your existing mysql password, so hopefully you have that. In my case the whole problem was caused when I decided to delete the existing root password in phpmyadmin (setting it to "") while that account was still set to require a password.

Hopefully this helps someone.

Blogged with Flock


Pooya Khalili said...

Thanks a lot for the post. Solved my problem.. Would you also know how you could make the password nit required? I guess that's the initial setting for MAMP?

centeroftheworld said...

Sorry, don't have that one for you. But I'm sure you can find it. Can you just reset everything to 'root'?

It's probably too high risk to make the password not required.

Anonymous said...

It worked for me! Thanks! Not even the mysql or MAMP websites or even phpmyadmin could help me. You did.


Deeleea said...

This just saved me hours.. thanks!

Anonymous said...

When I followed these instructions, I got this error message

/Applications/MAMP/Library/bin/mysqlcheck: Got error: 1045: Access denied for user 'root'@'localhost' (using password: YES) when trying to connect

and the start page shows a blank page with THIS error message: "Error: Could not connect to MySQL server!"

I turned the password BACK to root, and everything worked out okay. So the password change works, but for some reason, the MAMP MySQL server isn't registering the change....

What now?