Skip to content

OLD_PASSWORD

  • str varchar: This is the only parameter of OLD_PASSWORD function in MySQL. It is a string type variable where the user provides the password as input. This string of variable length is processed by the system to generate a hashed password output. It is important to note that VARCHAR requires a length specification which defines the maximum length for the input string in characters.
SELECT OLD_PASSWORD('password');
+--------------------------+
| OLD_PASSWORD('password') |
+--------------------------+
| 5e884898da28047151d0e56f |
+--------------------------+

In the given example, OLD_PASSWORD is a function used in MySQL to encrypt a password. The argument ‘password’ is passed to the function which returns an encrypted password.