- 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-tables
in the end
- restart the mysql and enter mysql by
./mysql
in the bin.
last: modify root password and reset the file my.cnf.