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 MySQL | Creating stored function The CREATE FUNCTION statement is used for creating a stored function and user-defined functions. A stored function is a set of SQL statements that perform some operation and return a single value. Just like Mysql in-built function, it can be called from within a Mysql statement. By default, the stor 2 min read REPLACE() Function in MySQL The REPLACE() function in MySQL is a powerful tool for string manipulation, allowing users to substitute specific substrings within a larger string. This functionality is particularly useful in various applications such as updating text data, cleaning up input or adjusting content in a database. In 3 min read MySQL | Change User Password Changing user passwords in MySQL is a common task for database administrators, ensuring the security of the database system. There are multiple ways to change a users password in MySQL, depending on our requirements and permissions. In this article, We will learn three methods to change a user's pas 3 min read SYSTEM_USER() Function in MySQL SYSTEM_USER() : This function helps to return the name of the user and hostname for the current MySQL user. And the SYSTEM_USER() function doesn't require any parameter to be passed. The username which will be returned is the name of the user-specified when connecting to the server. And the hostname 1 min read MySQL IF( ) Function The MySQL IF() function is a control flow function that returns different values based on the result of a condition. IF() Function in MySQLThe IF() function in MySQL returns a value if the condition is TRUE and another value if the condition is FALSE. The MySQL IF() function can return values that c 2 min read Like