It’s very useful to have a try, so make a record of it https://blog.csdn.net/wshxhghsjjsn/article/details/80459542
As like as two peas, I wrote the previous revision, but my MySQL version was 8. The current version is 5.7. So the screenshots are weird, but the steps are the same. I have tried all the 2 versions.
Step one: open as like as two peas, Command Line Client, see CMD, mysql, and you will find 2 identical ones.
Step 2: enter the password of MySQL. Enter is the password set when installing mysql. Only enter the password without semicolon
Step 3: enter alter user ‘root’ @’localhost ‘identified with MySQL_ native_ Password by ‘MySQL password’; Don’t miss the carriage return. There is a semicolon at the back. The password of MySQL is set when installing mysql
Step 4: input flush priorities; Don’t miss the semicolon at the back of the carriage return
Let me demonstrate: my MySQL password is 111111
The word “OK” won’t make a mistake
You can also modify the MySQL password through this method. For example, my MySQL password is 111111, I want to change it to 123456
That is to change the password of Mysql to 123456