Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save toritaba/1761066 to your computer and use it in GitHub Desktop.
Save toritaba/1761066 to your computer and use it in GitHub Desktop.
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`
$> ps auwx | grep mysql
$> launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment