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

MySQL detailed explanation of isolation level operation process (cmd)

Read uncommitted example operation process - Read...

React Hooks Detailed Explanation

Table of contents What are hooks? Class Component...

JS implements request dispatcher

Table of contents Abstraction and reuse Serial Se...

MySql common query command operation list

MYSQL commonly used query commands: mysql> sel...

HTML hyperlink a tag_Powernode Java Academy

Anyone who has studied or used HTML should be fam...

Detailed explanation of nginx optimization in high concurrency scenarios

In daily operation and maintenance work, nginx se...

Implementation of docker view container log command

Why should we read the log? For example, if the c...

Detailed explanation of MySQL startup options and system variables examples

Table of contents Boot Options Command Line Long ...

Example of MySQL auto-increment ID exhaustion

Display Definition ID When the auto-increment ID ...

Web Theory: Don't make me think Reading Notes

Chapter 1 <br />The most important principl...

js Promise concurrent control method

Table of contents question background Idea & ...

Docker port mapping and external inaccessibility issues

The Docker container provides services and listen...

Docker sets up port mapping, but cannot access the solution

#docker ps check, all ports are mapped CONTAINER ...

Detailed explanation of triangle drawing and clever application examples in CSS

lead Some common triangles on web pages can be dr...