Personal test method 3, the password has been reset successfully.
(Thank you @ very, for telling me that there is a reset method on the official website, and I searched a lot online...
In addition, step1 and 2 come from
English is not good, I don’t understand the official one# #)
step1:
Apple->System Preferences->Click mysql at the bottom and close the mysql service in the pop-up page (click stop mysql server)
step2:
Enter the terminal and enter: cd /usr/local/mysql/bin/
Press Enter and log in with administrator privileges sudo su
Press Enter and enter the following command to disable the mysql verification function./mysqld_safe --skip-grant-tables &
Return After restarting, mysql will automatically restart (the status of mysql in the preferences will change to running)
step3.
Enter the command./mysql
After pressing Enter, enter the command FLUSH PRIVILEGES;
After pressing Enter, enter the command SET PASSWORD FOR 'root'@'localhost' = PASSWORD('your new password');
At this point, the password change is completed. You can log in successfully.
The above is the detailed content of How to solve the problem of forgetting to change the password when installing mysql on mac?. For more information, please follow other related articles on the PHP Chinese website!