This tutorial explains how to use the MySQL OLD_PASSWORD function with syntax and examples.
The MySQL OLD_PASSWORD function is used by the authentication system to generate a hashed password from a plaintext password string, using hashing techniques prior to MySQL 4.1. To use newer hashing techniques, use the PASSWORD function.
The syntax for the OLD_PASSWORD function in MySQL is:
OLD_PASSWORD( string )
A plaintext password string that is the source to create an encrypted/hashed password in MySQL, using hashing techniques prior to MySQL 4.1.
The OLD_PASSWORD function can be used in the following versions of MySQL:
Let's look at some MySQL OLD_PASSWORD function examples and explore how to use the OLD_PASSWORD function in MySQL.
For example:
mysql> SELECT OLD_PASSWORD('abc');
Output: '7cd2b5942be28759'
mysql> SELECT OLD_PASSWORD('password');
Output: '5d2e19393cc5ef67'
mysql> SELECT OLD_PASSWORD('AODBA');
Output: '6dfd6aed19e9c757'
mysql> SELECT OLD_PASSWORD(NULL);
Output: NULL