MariaDB Tutorial MariaDB Advanced MariaDB Database Account Management MariaDB References

MariaDB OLD_PASSWORD() Function



The MariaDB OLD_PASSWORD() function is used by the authentication system in MariaDB to generate a hashed password from a plaintext password string, using older hashing techniques. To use newer hashing techniques, PASSWORD() function can be used which uses more powerful hashing as compared to older hashing techniques.

The OLD_PASSWORD() function returns the encrypted/hashed string, or NULL if the string is NULL.

The OLD_PASSWORD() function is used by the authentication system in MariaDB to store passwords.

Syntax

OLD_PASSWORD(string)

Parameters

string Required. Specify the plaintext password string that is the source to create an encrypted/hashed password in MariaDB, using older hashing techniques.

Return Value

Returns the encrypted/hashed password string.

Example:

The example below shows the usage of OLD_PASSWORD() function.

SELECT OLD_PASSWORD('xyz');
Result: '663c3a0b3da70572'

SELECT OLD_PASSWORD('password');
Result: '5d2e19393cc5ef67'

SELECT OLD_PASSWORD('alphacodingskills');
Result: '603a6f1a0d4653cc'

SELECT OLD_PASSWORD(123);
Result: '773359240eb9a1d9'

SELECT OLD_PASSWORD(NULL);
Result: NULL

❮ MariaDB Functions