Resetting your MySQL root password on Mac OSX Lion
Create a mysql-init file in your home directory containing:
UPDATE mysql.user SET Password=PASSWORD('{newrootpassword}') WHERE User='root';
FLUSH PRIVILEGES;
Stop MySQL
sudo launchctl unload -w /Library/LaunchDaemons/org.mysql.mysqld.plist
Run MySQL manually
mysqldsafe -user=mysql --init-file={homedirectorypath}/mysql-init &
Check you can login to MySQL using new password
mysql -u root -p
password: {newrootpassword}
Delete your mysql-init file
Kill your manually created MySQL process
Relaunch MySQL
sudo launchctl load -w /Library/LaunchDaemons/org.mysql.mysqld.plist
Written by Carlos Saba
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Mysql
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#