Get the App
SLTechnology News&Howtos  ›  Database  › 

Steps to reset the root password of mysql in Mac

Shulou Source: shulou.com Published: 2022-06-01 20:57:09 10月06日 Update

This article mainly introduces the operation steps of resetting the root password of mysql in Mac, which has certain reference value and can be used for reference by friends who need it. Come and have a look with me next.

My mysql version MYSQL V5.7.9, please use the old version:

UPDATE mysql.user SET Password=PASSWORD ('new password') WHERE User='root'

Mac OS X-reset the MySQL Root password

There are too many passwords to remember. Have you forgotten the root password of Mac OS's MySQL? You can reset the new password in the following 4 steps:

1. Stop mysql server.

Usually in 'system preferences' > MySQL > 'Stop MySQL Server'

two。 Open the terminal and enter:

Sudo / usr/local/mysql/bin/mysqld_safe-- skip-grant-tables

3. Open another new terminal and enter:

Sudo / usr/local/mysql/bin/mysql-u root UPDATE mysql.user SET authentication_string=PASSWORD ('your new password') WHERE User='root'; FLUSH PRIVILEGES; exit

4. Restart MySQL.

All right, that's it.

On the Mac reset mysql root password operation steps to share here, of course, not only the above and everyone analysis methods, but the editor can ensure its accuracy is absolutely no problem. I hope that the above content can have a certain reference value for everyone, and can be put into practice. If you like this article, you might as well share it for more people to see.

Tags: Password new secret step value version terminal reference input learning for application preference content accuracy method article is in more friends read it article system Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno OPPO Reno Shulou Technology Linux MariaDB Shulou Tech Info