PASSWORD
You are viewing an old version of this article. View
the current version here.
Syntax
PASSWORD(str)
Description
Calculates and returns a password string from the plaintext password
str
, or NULL if the argument was NULL.
As of MariaDB 5.5.3, the return value is a nonbinary string in the connection character set and collation, determined by the values of the character_set_connection and collation_connection system variables. Before 5.5.3, the return value was a binary string.
This is the function that is used for encrypting MariaDB passwords for storage in the Password column of the user table (see privileges), usually used with the SET PASSWORD statement.
Examples
SELECT PASSWORD('notagoodpwd'); +-------------------------------------------+ | PASSWORD('notagoodpwd') | +-------------------------------------------+ | *3A70EE9FC6594F88CE9E959CD51C5A1C002DC937 | +-------------------------------------------+
SET PASSWORD FOR 'bob'@'%.loc.gov' = PASSWORD('newpass');
See also
- simple_password_check plugin - permits the setting of basic criteria for passwords
Comments
Comments loading...
Content reproduced on this site is the property of its respective owners,
and this content is not reviewed in advance by MariaDB. The views, information and opinions
expressed by this content do not necessarily represent those of MariaDB or any other party.