I skipped the password policy of Mysql 5.7 and Mysql.

Source: Internet
Author: User

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 ~

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.