- go to the directory and find the file:my.cnf
/Applications/XAMPP/etc pwd
/Applications/XAMPP/etc
- open the file, search mysqld, add
skip-grant-tablesin the end

image.png
- restart the mysql and enter mysql by
./mysqlin the bin.
image.png
last: modify root password and reset the file my.cnf.
