Syntax\n------\n\nPASSWORD(str)\n\nDescription\n-----------\n\nThe PASSWORD() function is used for hashing passwords for use in authentication by the MariaDB server. It is not intended for use in other applications.\n\nCalculates and returns a hashed password string from the plaintext password _str_. Returns an empty string if the argument is NULL.\n\nThe 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.\n\nThis is the function that is used for hashing MariaDB passwords for storage in the Password column of the user table (see privileges), usually used with the SET PASSWORD statement. It is not intended for use in other applications.\n\nThe function takes into account the authentication plugin where applicable (a CREATE USER or SET PASSWORD statement). For example, when used in conjunction with a user authenticated by the ed25519 plugin, the statement will create a longer hash:\n\n``sql\nCREATE USER edtest@localhost IDENTIFIED VIA ed25519 USING PASSWORD('secret');\n\nCREATE USER edtest2@localhost IDENTIFIED BY 'secret';\n\nSELECT CONCAT(user, '@', host, ' => ', JSON_DETAILED(priv)) FROM mysql.global_priv\n  WHERE user LIKE 'edtest%'\\G\n************************ 1. row *********************\nCONCAT(user, '@', host, ' => ', JSON_DETAILED(priv)): edtest@localhost => {\n...\n    "plugin": "ed25519",\n    "authentication_string": "ZIgUREUg5PVgQ6LskhXmO+eZLS0nC8be6HPjYWR4YJY",\n...\n}\n********************* 2. row ***********************\nCONCAT(user, '@', host, ' => ', JSON_DETAILED(priv)): edtest2@localhost => {\n...\n    "plugin": "mysql_native_password",\n    "authentication_string": "14E65567ABDB5135D0CFD9A70B3032C179A49EE7",\n...\n}\n`\n\nThe behavior of this function is affected by the value of the old_passwords system variable. If this is set to 1 (0` is default), MariaDB reverts to using the mysql_old_password authentication plugin by default for newly created users and passwords.\n\nExamples\n--------\n\nSELECT PASSWORD('notagoodpwd');\n+-------------------------------------------+\n| PASSWORD('notagoodpwd')                   |\n+-------------------------------------------+\n| *3A70EE9FC6594F88CE9E959CD51C5A1C002DC937 |\n+-------------------------------------------+\n\nURL: https://mariadb.com/docs/server/reference/sql-functions/secondary-functions/encryption-hashing-and-compression-functions/password