I want to change a user's password in MySQL8.0, but almost none of the online methods seem to work.
Here are my mysql.user table details:
1 2 3 4 5 6 7 8 9 10 11 |
|
I have tried the following commands:
1 |
|
and received the error message:
1 |
|
I also tried to operate the mysql.user table myself:
1 2 |
|
Although it works, I cannot log in to yyy via (what I should be) password 12345. Then I took a look at the table and it looked really strange:
1 2 3 4 5 6 7 8 |
|
P粉0222857682024-01-02 09:59:10
For MySQL 8.0
Ordinary users use the following command to change the password
1 |
|
Root user uses the following command to change the password
P.S Check using password with "$A$005$", caching_sha2_password authentication plugin should be used, without "WITH caching_sha2_password" it will not work for root user. If it is a general user Permissions need to be granted.
1 |
|