bridgestew
8/4/2012 - 3:18 AM

effing mysql

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