MySQL | OLD_PASSWORD Function Last Updated : 17 Feb, 2021 Comments Improve Suggest changes Like Article Like Report The MySQL OLD_PASSWORD function is used for generating a hashed password from a plaintext password string. The OLD_PASSWORD function uses hashing techniques to perform the generation of the hashed password. This function is carried out by the authentication system. This function is used by the MySQL server to encrypt MySQL passwords for storage in the Password column of the user grant table. The value returned by the OLD_PASSWORD function is a hashed string, or NULL if the argument was NULL. The OLD_PASSWORD function accepts one parameter which is the string to be encrypted. Syntax: OLD_PASSWORD( plain_string ) Parameters Used: plain_string - It is used to specify the plain text string that is to be encrypted. Return Value: The OLD_PASSWORD function in MySQL returns a hashed string. Supported Versions of MySQL: MySQL 5.7MySQL 5.6MySQL 5.5MySQL 5.1MySQL 5.0MySQL 4.1 Example-1: Implementing OLD_PASSWORD function on a string. SELECT OLD_PASSWORD('xyz'); Output: 5re6hsuy7dsvgs25 Example-2: Implementing OLD_PASSWORD on a string with a combination of characters and integer values. SELECT OLD_PASSWORD('xyz123'); Output: 56fsrfshg312nsh34wf51 Example-3: Implementing OLD_PASSWORD function on a bigger string. SELECT OLD_PASSWORD('geeksforgeeks'); Output: 98dsygdy5syg43gs21 Example-4: Implementing OLD_PASSWORD function on a NULL string. SELECT OLD_PASSWORD('NULL'); Output: NULL Comment More infoAdvertise with us Next Article MySQL | OLD_PASSWORD Function S Shubrodeep Banerjee Follow Improve Article Tags : SQL mysql SQLmysql Similar Reads MySQL | PASSWORD Function The MySQL PASSWORD function is used for the generation of a hashed password using a plain-text password string It uses hashing techniques to generate the hashed password. This function is carried out by the authentication system. MySQL server uses the PASSWORD function to encrypt MySQL passwords for 1 min read MySQL NOW() function The NOW() function in MySQL is a powerful tool that returns the current date and time based on the server's time zone. This function is widely used when you need to capture the exact moment an event occurs such as when recording timestamps for records like orders, deliveries, or log entries. In this 3 min read MySQL | SHA1( ) Function The MySQL SHA1() function is used for encrypting a string using the SHA-1 technique. The SHA1 stands for secure hash algorithm and it produces a 160-bit checksum for a user inputted string. The MySQL SHA1() function returns NULL if the string passed as an argument is a NULL string. The SHA1() functi 1 min read MySQL | SESSION_USER( ) Function The MySQL SESSION_USER() function is used for returning the current user name and host name for the MySQL connection being used by the user. The SESSION_USER() function does not require any parameter to be passed. The user name returned by the SESSION_USER() function is the name of the user-specifie 1 min read MySQL | VERSION( ) Function The MySQL Version() function is used for returning the current version of the MySQL database. This function uses the utf8 character set. Generally, there is a suffix returned after the version number. The Version() function does not require any parameter to be passed. Syntax: VERSION() Parameters Us 1 min read Like