Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Mysql 5.7How to solve the problem of forgetting password

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

Editor to share with you how to solve the problem of forgetting passwords in mysql 5.7.I hope you will get something after reading this article. Let's discuss it together.

Mysql5.7 forgot the password solution: 1, modify the parameter file and skip password verification; 2, modify the password field; 3, restart mysql through "service mysqld restart".

This article operating environment: windows7 system, mysql version 5.7, Dell G3 computer.

The handling method of forgetting password in mysql5.7

[note] when MySQL5.7 forgets the root password, the processing method is somewhat different from the previous version, which is sorted out here as follows:

[1] modify the parameter file to skip password verification

Vim / etc/my.cnf# add a line in [mysqld] to skip permission restrictions skip-grant-tables# save exit restart mysql service service mysqld restart

[2] modify password field

# users log in to mysql-uroot-p (click enter directly, the password is empty) # but the password field does not exist in version 5.7, so we need to reset the password update mysql.user set authentication_string=password ('123456') where user='root';# refresh permission flush privileges with the following modification

[3] skip-grant-tables deletion and restart mysql in the initial modified configuration file my.cnf

Service mysqld restart

[4] when you log in to mysql, you will find that it will appear when you execute orders.

ERROR 1820 (HY000): You must reset your password using ALTER USER statement;# this is to prompt you to change your password when you execute SET PASSWORD = PASSWORD ('root'); # if ERROR 1819 (HY000): Your password does not satisfy the current policy requirements# appears, you need to execute two parameters to cancel the default password strength of mysql. Of course, you can also increase your password complexity, set global validate_password_policy=0; set global validate_password_mixed_case_count=2.

[5] after the above operations, the password change is completed.

After reading this article, I believe you have a certain understanding of "mysql 5.7 how to solve the problem of forgetting password". If you want to know more about it, you are welcome to follow the industry information channel. Thank you for reading!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report