How to change the root password of Mysql5.7.10 in MAC, mysql5.7.10root
First, skip the permission table mode to start MySQL:Mysqld -- skip-grant-tables &
From now on, you will step into the first pitfall. If you use the error modification method posted everywhere on the Internet:
Mysql> UPDATE mysql. user SET authentication_string = PASSWORD ('your _ new_password ') WHERE User = 'root ';
(Note: After 5.7, the password is changed to authentication_string.) Congratulations, you have modified the password successfully, but you will find that the following error will be reported when you use the navicat GUI tool for connection:
ERROR 1820 (HY000): You must reset your password using alter user statement before executing this statement.
At the same time, you will find that the command line can useMysql-u root-p
I have logged on, but I cannot use mysql. I cannot even use databases.
The following command will save you:
Mysql> set password = PASSWORD ('your _ new_password ');
RunMysqladmin-u root-p shutdown
Disable mysqld
When mysql. server start starts mysql again, it will all be OK ~
The above section describes how to change the root password of Mysql5.7.10 on MAC. I hope it will be helpful to you. If you have any questions, please leave a message for me, the editor will reply to you in a timely manner. Thank you very much for your support for the help House website!