1. Apple -> System Preferences -> Click mysql at the bottom to close the mysql service in the pop-up page
2. Enter the terminal
enter:
cd /usr/local/mysql/bin/
Log in with administrator privileges
sudo su
Enter the following command after pressing Enter to disable the mysql authentication function
./mysqld_safe --skip-grant-tables &
MySQL will restart after
3../mysqladmin -u root -p password 123 to change the password
Pro test, database recovery