Mac mysql installation password problem

step1:

Apple -> System Preferences -> Click mysql at the bottom to close the mysql service in the pop-up page (click stop mysql server)
step2:
Enter the terminal and enter: cd /usr/local/mysql/bin/
Enter and log in with administrator privileges
Enter the following command to disable the mysql authentication function after sudo su and press Enter./mysqld_safe --skip-grant-tables & after press
Enter, mysql will automatically restart (the status of mysql in the preferences will change to running)

step3.
Enter the command ./mysql
After carriage return, enter the command FLUSH PRIVILEGES;
after carriage return, enter the command SET PASSWORD FOR 'root'@'localhost' = PASSWORD('your new password');

step4.
Kill the mysql process, restart mysql

so far, and change the password Done, you can log in successfully

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=327040273&siteId=291194637