Created
July 28, 2021 08:57
-
-
Save perfectfoolish/cfe22b53021b2eff2f41ad463d3ce115 to your computer and use it in GitHub Desktop.
solve forget the root password of mysql installed by homebrew on macOS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ brew services stop mysql | |
$ pkill mysqld | |
$ rm -rf /usr/local/var/mysql/ # NOTE: this will delete your existing database!!! | |
$ brew postinstall mysql | |
$ brew services restart mysql | |
$ mysql -uroot |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment