五月天青色头像情侣网名,国产亚洲av片在线观看18女人,黑人巨茎大战俄罗斯美女,扒下她的小内裤打屁股

歡迎光臨散文網(wǎng) 會(huì)員登陸 & 注冊(cè)

修改MySQl密碼約束規(guī)則

2022-05-23 10:14 作者:Nimanggi  | 我要投稿

使用MySQL5.x時(shí),設(shè)置用戶密碼有可能會(huì)出現(xiàn)如下警告,這是因?yàn)樾略O(shè)置的密碼不符合MySql規(guī)定的密碼規(guī)則。



解決方式,一是設(shè)置符合規(guī)則的密碼,或是更改密碼規(guī)則限制。

這個(gè)規(guī)則的設(shè)置來(lái)源validate_password_policy字段的值。


validate_password_policy有以下取值:

| Policy? ? ? | Tests Performed? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?|

|-------------|-------------------------------------------------------------------------------|

| 0 or LOW? ? | Length? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? |

| 1 or MEDIUM | Length; numeric, lowercase/uppercase, and special characters? ? ? ? ? ? ? ? ? |

| 2 or STRONG | Length; numeric, lowercase/uppercase, and special characters; dictionary file |


默認(rèn)是1,即MEDIUM,所以剛開(kāi)始設(shè)置的密碼必須符合長(zhǎng)度,且必須含有數(shù)字,小寫或大寫字母,特殊字符。


設(shè)置validate_password_policy參數(shù)的值

```

mysql> set global validate_password_policy=0;

```


這里,具體規(guī)則的約束可以去網(wǎng)上檢索,例如:

```

mysql>?

mysql> select @@validate_password_length;

+----------------------------+

| @@validate_password_length |

+----------------------------+

|? ? ? ? ? ? ? ? ? ? ? ? ? 8 |

+----------------------------+

1 row in set (0.03 sec)

mysql>?

```

validate_password_length參數(shù)默認(rèn)為8,它有最小值的限制,最小值為:

```

validate_password_number_count

+ validate_password_special_char_count

+ (2 * validate_password_mixed_case_count)

```


其中,validate_password_number_count指定了密碼中數(shù)據(jù)的長(zhǎng)度,validate_password_special_char_count指定了密碼中特殊字符的長(zhǎng)度,validate_password_mixed_case_count指定了密碼中大小字母的長(zhǎng)度。


這些參數(shù),默認(rèn)值均為1,所以validate_password_length最小值為4,如果你顯性指定validate_password_length的值小于4,盡管不會(huì)報(bào)錯(cuò),但validate_password_length的值將設(shè)為4。如下所示:


```

mysql> select @@validate_password_length;

+----------------------------+

| @@validate_password_length |

+----------------------------+

|? ? ? ? ? ? ? ? ? ? ? ? ? 8 |

+----------------------------+

row in set (0.00 sec)


mysql> set global validate_password_length=1;

Query OK, 0 rows affected (0.00 sec)


mysql> select @@validate_password_length;

+----------------------------+

| @@validate_password_length |

+----------------------------+

|? ? ? ? ? ? ? ? ? ? ? ? ? 4 |

+----------------------------+

row in set (0.00 sec)

```


如果修改了validate_password_number_count,validate_password_special_char_count,validate_password_mixed_case_count中任何一個(gè)值,則validate_password_length將進(jìn)行動(dòng)態(tài)修改。

```

mysql> select @@validate_password_length;

+----------------------------+

| @@validate_password_length |

+----------------------------+

|? ? ? ? ? ? ? ? ? ? ? ? ? 4 |

+----------------------------+

row in set (0.00 sec)


mysql> select @@validate_password_mixed_case_count;

+--------------------------------------+

| @@validate_password_mixed_case_count |

+--------------------------------------+

|? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 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 |

+--------------------------------------+

row in set (0.00 sec)


mysql> select @@validate_password_length;

+----------------------------+

| @@validate_password_length |

+----------------------------+

|? ? ? ? ? ? ? ? ? ? ? ? ? 6 |

+----------------------------+

row in set (0.00 sec)

```


當(dāng)然,前提是validate_password插件必須已經(jīng)安裝,MySQL5.7是默認(rèn)安裝的。


那么如何驗(yàn)證validate_password插件是否安裝呢?可通過(guò)查看以下參數(shù),如果沒(méi)有安裝,則輸出將為空。


```

mysql> SHOW VARIABLES LIKE '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? ?|

| validate_password_special_char_count | 1? ? ?|

+--------------------------------------+-------+

rows in set (0.00 sec)

```



修改MySQl密碼約束規(guī)則的評(píng)論 (共 條)

分享到微博請(qǐng)遵守國(guó)家法律
原阳县| 威远县| 治县。| 四子王旗| 邯郸市| 英吉沙县| 永济市| 舒城县| 钟山县| 杂多县| 弥渡县| 景泰县| 定西市| 乌拉特前旗| 福泉市| 大邑县| 丘北县| 宣汉县| 五指山市| 咸丰县| 安溪县| 宁武县| 体育| 略阳县| 绵竹市| 安宁市| 邓州市| 老河口市| 临澧县| 湘潭市| 汶上县| 龙江县| 抚宁县| 班玛县| 修文县| 平湖市| 聂拉木县| 会昌县| 平利县| 四会市| 中阳县|