Solve the Mac under MySQL8.0.11 (if not mysql8 more than the version, please refer to other people's methods) forgot the initial password method to share to everyone, for your reference, the specific content as follows:
The first step:
Click MySQL on the bottom point of System Preferences, and on the pop-up page, close the service.
Step Two:
Enter Terminal input: cd/usr/local/mysql/bin/
Log in Administrator right after enter sudo su
Enter the following command to disable the MySQL authentication feature after entering the carriage return./mysqld_safe--skip-grant-tables &
MySQL will restart automatically after carriage return (the MySQL status in preferences will become running)
Step Three:
Enter the command./mysql
Enter command FLUSH privileges after carriage return;
After entering, enter the command ALTER user ' root ' @ ' localhost ' identified by ' your new password ';
Set mysql8.0.11 password under MacBook