Created
May 23, 2011 22:10
-
-
Save fallwith/987731 to your computer and use it in GitHub Desktop.
Reset MySQL root password (Homebrew)
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
$> launchctl unload -w ~/Library/LaunchAgents/com.mysql.mysqld.plist | |
$> /usr/local/Cellar/mysql/5.5.9/bin/mysqld --basedir=/usr/local/Cellar/mysql/5.5.9 --datadir=/usr/local/Cellar/mysql/5.5.9/data --plugin-dir=/usr/local/Cellar/mysql/5.5.9/lib/plugin --log-error=/usr/local/Cellar/mysql/5.5.9/data/errors.err --pid-file=/usr/local/Cellar/mysql/5.5.9/data/pidfile.pid --skip-grant-tables | |
$> mysql | |
mysql> UPDATE mysql.user SET Password=PASSWORD('root_password') WHERE User='root'; | |
mysql> FLUSH PRIVILEGES; | |
$> kill `cat /usr/local/Cellar/mysql/5.5.9/data/pidfile.pid` | |
$> ps auwx | grep mysql | |
$> launchctl load -w ~/Library/LaunchAgents/com.mysql.mysqld.plist |
$ 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
this work perfectly for me @imamalys THANK YOU!!!
Not working form me in macOS Sonoma 14.1.1
Any other solution?
$ 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
this work perfectly for me @imamalys THANK YOU!!!Not working form me in macOS Sonoma 14.1.1 Any other solution?
try this, It's works for me :)
https://aungzanbaw.medium.com/how-to-reset-root-user-password-in-mysql-8-0-a5c328d098a8
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@rajeswarivmarimuthu Did you ever figure out what is causing this? mine is doing the same thing