Search code examples
mysqlmamp

MAMP Error: checking MySQL databases failed


I recently reset the password from the root user in MySQL to a blank value. I verified in the config.inc.php file that this was the case:

$cfg['Servers'][$i]['user']          = 'root';      // MySQL user
$cfg['Servers'][$i]['password']      = '';          // MySQL password (only needed
                                                    // with 'config' auth_type) 

However, every time I restart the MAMP servers, this error pops up:

Checking the 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

However, I can still connect to my MySQL database perfectly fine through MySQLWorkBench. It's just that this silly error pops up every time, even though I don't have a password set. Why does this keep happening?

I've tried everything from restarting MAMP to resetting my password from the command line (the solution in the MAMP docs), to no avail. I also tried executing the following:

$ /Applications/MAMP/Library/bin/mysql -uroot -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g. 
...
mysql>

So I can successfully connect to MySQL through the terminal. Does this mean that the problem is in my phpMyAdmin configuration somewhere?


Solution

  • There are a bunch of mamp files that have a hard coded value for the root password in /Applications/MAMP/bin such as checkMysql.sh.

    You would need to change these files as well.

    Because you've reset it to an empty string, you will have to change the -proot to --password=, otherwise you could have used -pNEWPASS.

    The full list of files is checkMysql.sh, quickCheckMysqlUpgrade.sh, stopMysql.sh and upgradeMysql.sh that I can see.