How to change the root password of Mysql5.7.10 in MAC, mysql5.7.10root

Source: Internet
Author: User

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-pI 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 shutdownDisable 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!

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.