MySQL | PASSWORD Function Last Updated : 08 Nov, 2019 Comments Improve Suggest changes Like Article Like Report 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 storage in the Password column of the user grant table. The value returned by the PASSWORD function is a hashed string, or NULL if the argument was NULL. The PASSWORD function accepts one parameter which is the string to be encrypted. Syntax: PASSWORD( string_to_encrypt ) Parameters Used: string_to_encrypt - It is used to specify the plain text string that is to be encrypted. Return Value: The PASSWORD function in MySQL returns a hashed string. Supported Versions of MySQL: MySQL 5.7 MySQL 5.6 MySQL 5.5 MySQL 5.1 MySQL 5.0 MySQL 4.1 Example-1: Implementing PASSWORD function on a string. SELECT PASSWORD('xyz'); Output: 6gd7gb67shy87865 Example-2: Implementing PASSWORD function on a string with a combination of characters and integer values. SELECT PASSWORD('xyz123'); Output: 54fg56gs32sgi3862 Example-3: Implementing PASSWORD function on a bigger string. SELECT PASSWORD('geeksforgeeks'); Output: 79sgs54uksr1fy76509 Example-4: Implementing PASSWORD function on a NULL string. SELECT PASSWORD('NULL'); Output: NULL Comment More infoAdvertise with us Next Article MySQL | PASSWORD Function S Shubrodeep Banerjee Follow Improve Article Tags : SQL mysql SQLmysql Similar Reads MySQL | OLD_PASSWORD Function 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 1 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 | 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 MySQLi Procedural Functions MySQLi (MySQL Improved) provides procedural and object oriented interface to data and its management. The i extension MySQL functions allows the user to access its database servers. The MySQL improved extension is specially designed to work with MySQL version 4.1.13 and new versions.Advantages of us 12 min read Like