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)
Fifth step, enter the command./mysql
Enter command FLUSH privileges after carriage return;
Enter the command after the SET PASSWORD for ' root ' @ ' localhost ' = PASSWORD (' Your new password ');
At this point, the password modification completed, can be successfully logged in.
The command to log on to MySQL at the terminal is as follows: Mysql-u root-p
Then enter the password, and if you do not set the password, press ENTER directly.
- 4
If the content is displayed as follows, it is already successfully logged into the MySQL service.
MySQL reset password under Mac and login with user and password