The MariaDB PASSWORD() function generates a 41-character hash used to store user account passwords in the MySQL and MariaDB authentication system. It computes SHA1(SHA1(password)) — applying the SHA-1 hash function twice — and prefixes the result with an asterisk (*). This format has been used by MySQL since version 4.1 and remains compatible with MariaDB.
SELECT PASSWORD('mypassword'); — returns *6C8989366EAF75BB670AD8EA7A7FC1176A95CEF4
To create a user: CREATE USER 'user'@'localhost' IDENTIFIED BY 'mypassword';
Yes. You can set a user password with: UPDATE mysql.user SET authentication_string=PASSWORD('mypass') WHERE User='username'; followed by FLUSH PRIVILEGES;
Old MySQL 3.x passwords used a shorter 16-character format without the * prefix. MariaDB supports both, but the new format (with *) is preferred and much stronger.