Php – Changed root password for phpMyAdmin, now I can’t access anything MAMP

mampMySQLPHP

I thoroughly searched StackOverflow and Google to find an answer to this and so far nothing has helped. It's killing me because my project was pretty much finished!

In the control panel in phpMyAdmin I changed the password for the root user from 'root' to a new password. When I quit working and came back to it I couldn't connect to the server through MAMP, receiving this error:

Checking MySQL databases failed. Error message:
/Applications/MAMP/Library/bin/mysqlcheck: Got error: 1045: Access denied for user 'root'@'localhost' (using password: YES) when trying to connect

And this error on my localhost page:

Error: Could not connect to MySQL server!

I tried many things to try to resolve this issue, most of which I found from other SO questions. They are as follows:

I tried a bunch of other things like changing the auth_type to html, adding controluser and controlpass, and other things but no luck. Nothing seems to work.

Best Answer

Seriously, this is super easy to solve. Edit this line in the phpmyadmin/config.ini.php:

$cfg['Servers'][$i]['auth_type'] = 'config';

Just replace "config" by "cookie", so your like now looks like this

$cfg['Servers'][$i]['auth_type'] = 'cookie';

Now you'll be asked your password.

ps.: undo all your previous edits to this file trying to solve the problem, and do not write the root password in it. If you don't remember your edits, just start over by using phpmyadmin/config.sample.ini.php