1MacOSX MySql root Password Reset master solution
2Step by step guide-
3$ brew services stop mysql
4$ pkill mysqld
5$ rm -rf /usr/local/var/mysql/ # NOTE: this will delete your existing database!!!
6$ brew postinstall mysql
7$ brew services restart mysql
8$ mysql -u root
1Make sure you have Stopped MySQL first (above).
2Run the server in safe mode with privilege bypass: sudo mysqld_safe --skip-grant-tables
3mysql -u root
4UPDATE mysql.user SET authentication_string=null WHERE User='root';
5FLUSH PRIVILEGES;
6exit;
7Then
8mysql -u root
9ALTER USER 'root'@'localhost' IDENTIFIED WITH caching_sha2_password BY 'yourpasswd';