以root身份登入phpmyadmin 或文字介面
查詢限制
mysql> select @@validate_password_length;
MySQL預設密碼長度就是8字元
想要修改密碼長度最少限制,可以輸入下列SQL語法:
mysql> set global validate_password_length=3;
查詢/修改 MySQL密碼驗證原則
mysql> select @@validate_password_policy;
MySQL密碼驗證原則對照表:
Policy Value | Tests Performed |
0/Low | LOW Length |
1/MEDIUM | MEDIUM Length; numeric, lowercase/uppercase, and special characters |
2/STRONG | STRONG Length; numeric, lowercase/uppercase, and special characters; dictionary file |
解決錯誤
方法1:提升密碼強度
方法2:暫時降低密碼驗證原則等級,完成密碼設定後,再將等級復原!
mysql> set global validate_password_policy=0; mysql> set global validate_password_length=3;