- Make sure mysql service stopped
mysql.server stop
orbrew services stop mysql
- Create a text file somewhere ex.
/Users/iambudi/reset_pass.txt
and write this one liner sql to the file:
ALTER USER 'root'@'localhost' IDENTIFIED BY 'ReplaceNewPassHere';
- Run mysql service
mysqld --init-file=/Users/iambudi/reset_pass.txt
- Connect to mysql using the new password
When things goes okay, delete the reset_pass.txt
, stop and start mysql again.