Skip to content

Instantly share code, notes, and snippets.

@perfectfoolish
Created July 28, 2021 08:57
Show Gist options
  • Save perfectfoolish/cfe22b53021b2eff2f41ad463d3ce115 to your computer and use it in GitHub Desktop.
Save perfectfoolish/cfe22b53021b2eff2f41ad463d3ce115 to your computer and use it in GitHub Desktop.
solve forget the root password of mysql installed by homebrew on macOS
$ 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