This article mainly introduces the method of changing the root password in version 5.7.10 of Mysql under MAC. It is very good and has reference value. Friends who need it can refer to it
Jump first Start MySQL in permission table mode: mysqld --skip-grant-tables &
From now on, you will step into the first pit. If you use the error correction posted everywhere on the Internet Method:
mysql> UPDATE mysql.user SET authentication_string=PASSWORD('your_new_password') WHERE User='root';
(Note that password was changed to authentication_string after 5.7) Congratulations, your modification is successful, but you will find that when you use a GUI tool like navicat to connect, the following error will be reported:
ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.
At the same time, you will find that you can use the command line to log in mysql -u root -p
, but you can’t use mysql, and you can’t even use the library. What’s wrong?
The following command will save you:
mysql> SET PASSWORD = PASSWORD('your_new_password');
Use the command after execution mysqladmin -u root -p shutdown
Close mysqld
Start mysql again with mysql.server start Everything is ok~
The above is the detailed content of Detailed introduction to the method of changing the root password in Mysql5.7.10 version under MAC. For more information, please follow other related articles on the PHP Chinese website!