Skip to content

Instantly share code, notes, and snippets.

@sebasjimenez10
Last active October 14, 2016 14:27
Show Gist options
  • Save sebasjimenez10/0a7e770db7a7b78343332a63d83e7056 to your computer and use it in GitHub Desktop.
Save sebasjimenez10/0a7e770db7a7b78343332a63d83e7056 to your computer and use it in GitHub Desktop.
Resting MySQL Root Password

Resetting MySQL root user password on Mac ( OSX El Capitan 10.11.x )

  1. System Preferences > MySQL > Stop MySQL Server
  2. From a terminal: sudo /usr/local/mysql/bin/mysqld_safe --skip-grant-tables
  3. From a new terminal: sudo /usr/local/mysql/bin/mysql -u root
  4. From mysql> FLUSH PRIVILEGES;
  5. From mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'NEWPASSOWORD';
  6. From mysql> \q
  7. Stop server
  8. Start server
  9. Test connection with new password: mysql -u root -p
  10. Type new password
  11. Bingo!

Alternatives to some steps

  1. and 7. sudo /usr/local/mysql/support-files/mysql.server stop
  2. sudo /usr/local/mysql/support-files/mysql.server start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment