Skip to content

Instantly share code, notes, and snippets.

@bridgestew
Created August 4, 2012 03:18
Show Gist options
  • Save bridgestew/3253934 to your computer and use it in GitHub Desktop.
Save bridgestew/3253934 to your computer and use it in GitHub Desktop.
Has a rake task ever borked your mysql login? Yeah, well, after spending an
evening figuring out how to solve it, here it is:
Stop mysql
launchctl unload -w ~/Library/LaunchAgents/com.mysql.mysqld.plist
Replace this with your version of this path, MySQL version:
/usr/local/Cellar/mysql/5.5.12/bin/mysqld --skip-grant-tables
Open new terminal window...
mysql
At the mysql prompt...
Replace [password] with the password you intend to use:
UPDATE mysql.user SET Password=PASSWORD('[password]') WHERE User='root';
FLUSH PRIVILEGES;
exit
Need to kill the mysql project in other terminal window:
ps aux | grep 'mysql'
kill [pid from last command]
Start mysql
launchctl load -w ~/Library/LaunchAgents/com.mysql.mysqld.plist
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment