I skipped the password policy of Mysql 5.7 and Mysql.
Mysql has no password policy since mysql 5.6, so we can set the password for every user as we like, what is 123, abc, or even a space, that is OK.
The mysql. user table also contains the password field to identify the location of the password.
But when I upgrade to MySQL 5.7. With the password policy added, the password policy is installed in linux. By default, the Medium Standard password policy is used. Available
Show variables like '% validate_password %' to view
For this part of knowledge, you can go to this Jonsea blog to check the http://www.cnblogs.com/jonsea/p/5510219.html
In version 5.7 (Linux installation), the password policy is as follows by default.
The default length is 8 characters long and case sensitive. So if we use 123 or, it doesn't work in this version. (Of course, you can set these settings by yourself ).
So here, you only need to execute select password ("123"); and an error is reported directly, even the encrypted string will not come out, and an error will be thrown.
Error Code: 1819. Your password does not satisfy the current policy requirements
Therefore, you don't need to count on this method. However, you can change the password directly.
For example, I obtained the select password ("5.6") -- * 23AE809DDACAF96AF0FD78ED04B6A265E05AA257 from version 123.
By 5.7, I can directly paste this string into the system table.
Update mysql. user set authentication_string = "* 23AE809DDACAF96AF0FD78ED04B6A265E05AA257" -- the password ("123") is used here to report an error, but it will not be assigned directly.
Where user = XXX;
Flush.
Conclusion: This method is suitable for server migration. It is useful if the password change is troublesome and IP address switch is only required ~