MySql forgotten password modification method is suitable for versions 5.7 and above

MySql forgotten password modification method is suitable for versions 5.7 and above

1. Stop the mysqld.exe process first

2. Open cmd and enter the bin directory of your mysql and enter this command:

mysqld --skip-grant-tables

After the input is completed, this cmd window cannot be used. Open another one as shown in the figure:

3. Also enter the bin directory of mysql and directly enter mysql and press Enter. Now the password verification is skipped and the database is linked as shown in the figure:

4. Check the user table in mysql to see our login username and password

If you are interested, you can check it out yourself

5. Pay special attention here that there is no password field in the user table in versions above 5.7

The password field seems to have become authentication_string. You can change it by using this statement.

update mysql.user set authentication_string=password('123456') where user='root' and Host = 'localhost';

6. Final execution:

flush privileges;

That's it.

The above is the MySql forgotten password modification method introduced by the editor, which is suitable for versions 5.7 and above. I hope it will be helpful to everyone. If you have any questions, please leave me a message and the editor will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website!

You may also be interested in:
  • What to do if you forget the initial password of MySQL on MAC
  • What to do if you forget the initial password of MySQL on MAC
  • What to do if you forget the root password of Mysql5.7 (simple and effective method)
  • How to reset mysql password after forgetting it on Mac
  • The perfect solution for forgetting the root password of Mysql
  • How to reset the MySQL password after forgetting it in Mac operating system

<<:  Vue resets data to its initial state

>>:  Linux lossless expansion method

Recommend

Web Design Experience: Efficiently Writing Web Code

Originally, this seventh chapter should be a deep ...

How to implement insert if none and update if yes in MySql

summary In some scenarios, there may be such a re...

Seven ways to implement array deduplication in JS

Table of contents 1. Using Set()+Array.from() 2. ...

How to solve jQuery conflict problem

In front-end development, $ is a function in jQue...

jQuery implements accordion small case

This article shares the specific code of jQuery t...

Docker builds cluster MongoDB implementation steps

Preface Due to the needs of the company's bus...

How to shrink the log file in MYSQL SERVER

The transaction log records the operations on the...

Bugs encountered when using mybatis-generator with mysql8.0.3 in IDEA

1. Add the plug-in and add the following configur...

How to install MySQL server community version MySQL 5.7.22 winx64 in win10

Download: http://dev.mysql.com/downloads/mysql/ U...

Analysis of the difference between HTML relative path and absolute path

HTML beginners often encounter the problem of how ...

Detailed explanation of the usage of setUp and reactive functions in vue3

1. When to execute setUp We all know that vue3 ca...

How does MySQL ensure data integrity?

The importance of data consistency and integrity ...