Skip to content

Instantly share code, notes, and snippets.

@toritaba
toritaba / homebrew_mysql_pass_reset.txt
Created February 7, 2012 18:15 — forked from fallwith/homebrew_mysql_pass_reset.txt
Reset MySQL root password (Homebrew)
$> launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
$> /usr/local/Cellar/mysql/5.5.19/bin/mysqld --basedir=/usr/local/Cellar/mysql/5.5.19 --datadir=/usr/local/var/mysql --plugin-dir=/usr/local/Cellar/mysql/5.5.19/lib/plugin --log-error=/usr/local/Cellar/mysql/5.5.19/data/errors.err --pid-file=/usr/local/Cellar/mysql/5.5.19/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.19/data/pidfile.pid`