语法:
PASSWORD(str)
描述:
PASSWORD() 函数 生成 哈希值用于MariaDB服务的验证。
运算并返回一个String类型的哈希值密码。
如果参数是NULL,则返回空字符串。
CREATE USER edtest@localhost IDENTIFIED VIA ed25519 USING PASSWORD('secret'); CREATE USER edtest2@localhost IDENTIFIED BY 'secret'; SELECT CONCAT(user, '@', host, ' => ', JSON_DETAILED(priv)) FROM mysql.global_priv WHERE user LIKE 'edtest%'G
*************************** 1. row *************************** CONCAT(user, '@', host, ' => ', JSON_DETAILED(priv)): edtest@localhost => { ... "plugin": "ed25519", "authentication_string": "ZIgUREUg5PVgQ6LskhXmO+eZLS0nC8be6HPjYWR4YJY", ... } *************************** 2. row *************************** CONCAT(user, '@', host, ' => ', JSON_DETAILED(priv)): edtest2@localhost => { ... "plugin": "mysql_native_password", "authentication_string": "*14E65567ABDB5135D0CFD9A70B3032C179A49EE7", ... }