Home > Database > Mysql Tutorial > body text

Teach you how to quickly reset mysql root password on Mac

藏色散人
Release: 2021-10-29 15:12:44
forward
2214 people have browsed it

Teach you how to quickly reset mysql root password on Mac

Reset the root password of mysql under Mac

My mysql version is MYSQL V5.7.9. For older versions, please Use:

UPDATE mysql.user SET Password=PASSWORD('新密码') WHERE User='root';
Copy after login

Mac OS X - Reset MySQL Root Password

Too many passwords to remember? ? Have you forgotten the root password of MySQL on Mac OS? You can reset the new password by following 4 steps:

1. Stop mysql server.

Usually in 'System Preferences' > ; MySQL > 'Stop MySQL Server'

2. Open the terminal and enter:
 sudo /usr/local/mysql/bin/mysqld_safe --skip-grant-tables
Copy after login
3. Open another new terminal and enter:
   sudo /usr/local/mysql/bin/mysql -u root

     UPDATE mysql.user SET authentication_string=PASSWORD('你的新密码') WHERE User='root';

     FLUSH PRIVILEGES;

     exit
Copy after login
4. Restart MySQL .

Okay, this is complete

Recommended learning: "mysql video tutorial"

The above is the detailed content of Teach you how to quickly reset mysql root password on Mac. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:segmentfault.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!