MySQL error 1819 (HY000) workaround

Source: Internet
Author: User

ERROR 1819 (HY000): Your password does not satisfy the current policy requirements,

What if this problem arises?

To enhance security, MySQL5.7 randomly generates a password for the root user, in error log, about the location of the error log and, if the RPM package is installed, the default is/var/log/mysqld.log.

Generally available through Log_error settings

Select @ @log_error; +---------------------+| @ @log_error     |+---------------------+|/var/log/mysqld.log |+---------------------+1in  Set (0.00 sec)

MySQL's temporary password can be obtained via the # grep "password"/var/log/mysqld.log command

Copy CodeThe code is as follows: 2016-01-19t05:16:36.218234z 1 [Note] A temporary password is generated for [email protected]: waq,qr%be2 (5

After you log on to the server with this password, you must change the password immediately, or you will receive the following error:

Select1820using this statement.

If you just change to a simple password, the following error will be reported:

' 12345678 '  1819 (HY000): Your password does not satisfy the current policy requirements

This is actually related to the value of Validate_password_policy.

The validate_password_policy has the following values:

The default is 1, which is medium, so the password you just started must match the length and must contain numbers, lowercase or uppercase letters, special characters.

Sometimes, just for your own testing, don't want to set the password so complicated, for example, I just want to set the root password is 123456.

Two global parameters must be modified:

First, modify the value of the Validate_password_policy parameter

Set Global validate_password_policy=00 rows affected (0.00 sec)

In this way, the criteria for judging the password is based on the length of the password. This is determined by the Validate_password_length parameter.

Select @ @validate_password_length; +----------------------------+| @ @validate_password_length |+----------------------------+|             8 |+----------------------------+1inset (0.00 sec)

The Validate_password_length parameter defaults to 8, and it has the minimum limit, and the minimum value is:

validate_password_number_count+ validate_password_special_char_count+ (2 * Validate_ Password_mixed_case_count)

which

VALIDATE_PASSWORD_NUMBER_COUNT Specifies the length of the data in the password,

VALIDATE_PASSWORD_SPECIAL_CHAR_COUNT Specifies the length of the special characters in the password,

VALIDATE_PASSWORD_MIXED_CASE_COUNT Specifies the length of the size letter in the password.

These parameters, the default value is 1, so the Validate_password_length minimum value is 4, if you explicitly specify that the value of validate_password_length is less than 4, although there is no error, but Validate_password_ The value of length will be set to 4. As shown below:

Mysql>Select@ @validate_password_length;+----------------------------+| @ @validate_password_length |+----------------------------+|8|+----------------------------+1Rowinch Set(0.00sec) MySQL>Set GlobalValidate_password_length=1; Query OK,0Rows Affected (0.00sec) MySQL>Select@ @validate_password_length;+----------------------------+| @ @validate_password_length |+----------------------------+|4|+----------------------------+1Rowinch Set(0.00Sec

If you modify the Validate_password_number_count,validate_password_special_char_count,validate_password_mixed_case_ Any value in count, Validate_password_length is dynamically modified.

Mysql> SELECT @ @validate_password_length; +----------------------------+|             @ @validate_password_length |+----------------------------+| 4 |+----------------------------+1 row in Set (0.00 sec) mysql> SELECT @ @validate_password_mixed_case_count; +------- -------------------------------+|                  @ @validate_password_mixed_case_count |+--------------------------------------+| 1 |+--------------------------------------+1 row in Set (0.00 sec) mysql> Set global Validate_password_mixed_case_ count=2; Query OK, 0 rows Affected (0.00 sec) mysql> SELECT @ @validate_password_mixed_case_count; +--------------------------- -----------+|                  @ @validate_password_mixed_case_count |+--------------------------------------+| 2 |+--------------------------------------+1 row in Set (0.00 sec) mysql> SELECT @ @validate_password_length; +------- ---------------------+|             @ @validate_password_length |+----------------------------+| 6 |+----------------------------+1 row in Set (0.00 sec) 

  

Of course, if the Validate_password plugin must already be installed, MySQL5.7 is installed by default.

So how do you verify that the Validate_password plugin is installed? You can view the following parameters, and if not installed, the output will be empty.

' validate_password% ' ; +--------------------------------------+-------+| Variable_name            | Value |+--------------------------------------+-------+| Validate_password_dictionary_file  | |    | validate_password_length       6   | | validate_password_ Mixed_case_count  2   | | validate_password_number_count    1   | | validate_ Password_policy       | Low  1   |+--------------------------------------+-------+6inset (0.00 sec)

MySQL error 1819 (HY000) workaround

Related Article

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.