I recently changed my root password for MySQL and forgot that I had done so.. when I restarted MAMP I got :
Error: Could not connect to MySQL server!
Simple fix, open :
/Applications/MAMP/bin/mamp/index.php
and update the root users password :
$link = @mysql_connect(':/Applications/MAMP/tmp/mysql/mysql.sock', 'root', 'newpassword');
if you get this screen :
Simple Fix : Open
/Applications/MAMP/bin/phpMyAdmin/config.inc.php
Update line below with new password (note: this is for a basic install of MAMP on Mac).
$cfg['Servers'][$i]['password'] = root
thank you !
hmm. didn’t work for me. i’ll keep searching.
my index.php = $link = @mysql_connect(‘:/Applications/MAMP/tmp/mysql/mysql.sock’, ‘root’, ‘root’);
my config.ini.php = $cfg[‘Servers’][$i][‘password’] = ‘root’;
Thanks for the post.
Worked for me on Mountain Lion – fixing the issue – I recently changed my root password ……..
Cheers!
clear your browser data in every try
I keep forgetting to clear browser data!!! Just wasted 30 minutes on this. After fixing everything, I could not figure out why I was still getting this error from phpMyAdmin.
Thank You
@tebx
I can’t thank you enough!!! I know I’m savvy enough to edit a few files, but it still wouldn’t connect. Several hours later, I realize that all I have to do is empty my browser cache!!! After hours of serious web browsing, you’re comment saves the day (as in the day that I lost trying to figure this out!). THANKS!!!
and remember to allow root login in this line
$cfg[‘Servers’][$i][‘AllowRoot’] = TRUE; // whether to allow root login
Thanks so much! This was really easy and help me a ton!
Thanks!
sudo /Applications/MAMP/Library/bin/mysqladmin -u root -p password NewPassword
Saved my skin!
Beautiful, man. Esp the tip on the *$&%!)^ cache files!
Worked perfectly, thanks!