Collections:
VALIDATE_PASSWORD_STRENGTH() - Password Strength Test
How to test the strength of a password using the VALIDATE_PASSWORD_STRENGTH() function?
✍: FYIcenter.com
VALIDATE_PASSWORD_STRENGTH(password) is a MySQL built-in function that
calculates the strength of a given password.
It requires validate_password plugin component to be installed.
For example:
SELECT VALIDATE_PASSWORD_STRENGTH('MyPassword');
-- +------------------------------------------+
-- | VALIDATE_PASSWORD_STRENGTH('MyPassword') |
-- +------------------------------------------+
-- | 0 |
-- +------------------------------------------+
INSTALL COMPONENT 'file://component_validate_password';
SELECT VALIDATE_PASSWORD_STRENGTH('MyPassword');
-- +------------------------------------------+
-- | VALIDATE_PASSWORD_STRENGTH('MyPassword') |
-- +------------------------------------------+
-- | 50 |
-- +------------------------------------------+
SELECT VALIDATE_PASSWORD_STRENGTH('123456');
-- +--------------------------------------+
-- | VALIDATE_PASSWORD_STRENGTH('123456') |
-- +--------------------------------------+
-- | 25 |
-- +--------------------------------------+
SELECT VALIDATE_PASSWORD_STRENGTH('123');
-- +-----------------------------------+
-- | VALIDATE_PASSWORD_STRENGTH('123') |
-- +-----------------------------------+
-- | 0 |
-- +-----------------------------------+
SELECT VALIDATE_PASSWORD_STRENGTH('430LwchJ$n');
-- +------------------------------------------+
-- | VALIDATE_PASSWORD_STRENGTH('430LwchJ$n') |
-- +------------------------------------------+
-- | 100 |
-- +------------------------------------------+
Reference information of the VALIDATE_PASSWORD_STRENGTH() function:
VALIDATE_PASSWORD_STRENGTH(password): score Normalizes a given MySQL statement into a statement digest. Arguments, return value and availability: password: Required. The password string to be tested. score: Return value. The test score between 0 and 100. Available since MySQL 4.1. Test criteria and scores: Criteria Score -------- ----- Length < 4 0 Length ≥ 4 and < validate_password.length 25 Satisfies policy 1 (LOW) 50 Satisfies policy 2 (MEDIUM) 75 Satisfies policy 3 (STRONG) 100
⇒ MySQL Functions on UUID Values
⇐ UNCOMPRESSED_LENGTH() - Uncompressed Data Length
2024-12-18, 2280🔥, 0💬
Popular Posts:
Where to find answers to frequently asked questions I am new to Oracle database. Here is a list of f...
How To Disable a Login Name in SQL Server? If you want temporarily disable a login name, you can use...
Can Date and Time Values Be Converted into Integers in SQL Server Transact-SQL? Can date and time va...
Where to find answers to frequently asked questions on Storage Engines: MyISAM, InnoDB and BDB in My...
How To Count Rows with the COUNT(*) Function in SQL Server? If you want to count the number of rows,...