MySQL OLD_PASSWORD() function
OLD_PASSWORD() function
MySQL old_password() returns a binary string from a plain text password and intended to be used to reset passwords for any pre-4.1 MySQL clients that need to connect to MySQL server 5.1.
The function returns NULL if the string supplied as the argument was NULL.
MySQL server uses this function to encrypt MySQL passwords for storage in the Password column of the user grant table.
Syntax:
OLD_PASSWORD(string);
Argument:
Name | Description |
---|---|
string | A string which is to be encrypted using PASSWORD function. |
Syntax Diagram:

MySQL Version: 5.6
Example:
Code:
SELECT OLD_PASSWORD('w3resource');
Explanation:
The above MySQL statement encrypts the plain text string w3resource and returns a binary string 4e8fd7b041ff73bf.
Sample Output:
mysql> SELECT OLD_PASSWORD('w3resource'); +----------------------------+ | OLD_PASSWORD('w3resource') | +----------------------------+ | 4e8fd7b041ff73bf | +----------------------------+ 1 row in set (0.00 sec)
Previous: MD5()
Next: PASSWORD()
- Weekly Trends
- Java Basic Programming Exercises
- SQL Subqueries
- Adventureworks Database Exercises
- C# Sharp Basic Exercises
- SQL COUNT() with distinct
- JavaScript String Exercises
- JavaScript HTML Form Validation
- Java Collection Exercises
- SQL COUNT() function
- SQL Inner Join
- JavaScript functions Exercises
- Python Tutorial
- Python Array Exercises
- SQL Cross Join
- C# Sharp Array Exercises
We are closing our Disqus commenting system for some maintenanace issues. You may write to us at reach[at]yahoo[dot]com or visit us at Facebook