Reset MySQL root password to “default” - MAMP

本秂侑毒 提交于 2019-12-03 03:45:46

This seemed to have fixed it when using terminal to reset the password:

/Applications/MAMP/Library/bin/mysqladmin -u root -p password newpassword

Found on mamp faq.

Look in the files:

  • checkMysql.sh
  • quickCheckMysqlUpgrade.sh
  • repairMysql.sh
  • stopMysql.sh

The important one in this case is "quickCheckMysqlUpgrade.sh". All the files are located in the /Applications/MAMP/bin/ directory.

In these files you'll find something like

# /bin/sh
/Applications/MAMP/Library/bin/mysqlcheck --quick --check-upgrade -u root -proot --socket=/Applications/MAMP/tmp/mysql/mysql.sock mysql

When you see -proot that is the password MAMP will try to use, -p{password}.

-p means "password" and whatever comes after is the password. So change "-proot" to eg. "-pmysecret" or whatever your password is.

I was being annoyed by the startup "access denied" error MAMP would show, even though I was able to access my site using phpMyAdmin or other SQL tools. I even found/updated the password in checkMysql.sh, repairMysql.sh, and upgradeMysql.sh. I did not notice the script called quickCheckMysqlUpgrade.sh and correcting the password in that fixed the startup error for me.

LAOMUSIC ARTS

I just solved this issue on my MBP! In MAMP Pro (v352), go to the MySQL tab and press "Change Password".

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!